Page 1 of 1

QUESTION, setting super globals

Posted: Tue Aug 18, 2009 11:38 pm
by vichiq
hello again people, I'm working on a site, wherein an administrator can look up for registered users, and after querying the database, data is then displayed as links, i would want that when the administrator clicks on one of those links a superglobal value is then changed to the value taken from the linked clicked.


any idea on how id be able to do this? help will be really appreciated. :)

Re: QUESTION, setting super globals

Posted: Wed Aug 19, 2009 8:06 am
by yacahuma
i think you are getting confuse, superglobals in php are $_GET, $_POST,$_SESSION, $_REQUEST, etc
I dont think you want to change those

Re: QUESTION, setting super globals

Posted: Wed Aug 19, 2009 9:25 am
by Ollie Saunders
Use the string facilities of PHP to construct a URL:

Code: Select all

echo '<a href="?user=' . $userId. '">' . "$userName</a>";
A relative URL such as ?user=10 will link back to the page that outputs that URL with $_GET['user'] being set to 10. Basic PHP tutorials will explain this more completely.