pass variables through hyperlink in php
Hi guys...Ive got a site with 10 hyperlinks ....when any of these hyperlinks is pressed I want to load a new page which displays info depending on the link pressed....
I mean in receiving page how can I determine which link was pressed...like ifset() or something like it... Is it possible?? |
If you hyperlink looks something like "page.php?id=3", then in the PHP program, you'll get a variable called $_REQUEST['id'], which will have a value of "3".
Any value passed in the query string that way will be available in the $_REQUEST array. Hope that helps. :) |
You can also find it by using $_GET["id"], which will only return variables in the URL (i.e. using the GET method). Using $_REQUEST["id"] will check GET variables, POST variables, and cookie variables; but I don't know in which order. So you might be safer to use $_GET instead of $_REQUEST.
|
All times are GMT -5. The time now is 03:23 AM. |