Page 1 of 1

URL use "/" instead of "?" to send variables

Posted: Mon Jun 21, 2010 2:52 am
by rahulephp
Hi,
In normal php, We use ?id=123 to send variable through URL.

So, the URL would be www.example.com/page.php?id=123 and then we use $_REQUEST['id'] to receive the variable on another page.

But my question is, if I use "/" instead of "?" (Ex: www.example.com/page.php/id/123), then how to receive the "id" on page.php.

$_REQUEST['id'] doesn't works in this case.

Thank you in advance

Re: URL use "/" instead of "?" to send variables

Posted: Mon Jun 21, 2010 7:43 am
by cpetercarter
You need to learn about how to use an .htaccess file and the Apache rewrite module to rewrite URLs. Start by googling "url rewriting".