QUESTION, setting super globals

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vichiq
Forum Newbie
Posts: 6
Joined: Tue Jul 28, 2009 12:35 pm

QUESTION, setting super globals

Post 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. :)
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: QUESTION, setting super globals

Post 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
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Re: QUESTION, setting super globals

Post 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.
Post Reply