Idea needed: How to pass a value to a page with a click?

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
User avatar
Ir0nSpIkE
Forum Newbie
Posts: 7
Joined: Mon May 16, 2005 4:25 pm
Location: On the Island, BC Canada

Idea needed: How to pass a value to a page with a click?

Post by Ir0nSpIkE »

Hi

I'm a Newbie looking for ideas: I'm generating a list of clients in a loop and displaying them as a link. I want to open the new page and pass it a Client ID so I can run a new query to display more info. But How?
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

It's called a Query String and you add it to your link in this fashion:

Code: Select all

<a href=&quote;somepage.php?someval=1234&quote;>link</a>
Then you get the value like this:

Code: Select all

echo $_GET['someval']; //outputs 1234
User avatar
Ir0nSpIkE
Forum Newbie
Posts: 7
Joined: Mon May 16, 2005 4:25 pm
Location: On the Island, BC Canada

Post by Ir0nSpIkE »

THANKS! :D
Post Reply