php querystring

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
besly98
Forum Newbie
Posts: 15
Joined: Sun Feb 22, 2009 5:50 pm

php querystring

Post by besly98 »

Hi all, im new to php and i cant for the life of me work out how to do a querystring in php. looked at loads of tutorials.... none work. has anyone got a simple example they can give me? i can expand from there?

thanks
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: php querystring

Post by alex.barylski »

Access the PHP script like:

Code: Select all

test.php?name=Ted&age=19
The script would look like:

Code: Select all

 
<?php
 
  echo $_GET['name'];
 
The output would be:

Code: Select all

Ted
besly98
Forum Newbie
Posts: 15
Joined: Sun Feb 22, 2009 5:50 pm

Re: php querystring

Post by besly98 »

ok.. but say i have an id for a usser....and i want that id toappear in the URL... so a page becomes unique to each individual.... how do i do this?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: php querystring

Post by John Cartwright »

Moved to PHP-Code.
besly98
Forum Newbie
Posts: 15
Joined: Sun Feb 22, 2009 5:50 pm

Re: php querystring

Post by besly98 »

sorry that not make sense
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: php querystring

Post by John Cartwright »

What doesn't make sense?
besly98
Forum Newbie
Posts: 15
Joined: Sun Feb 22, 2009 5:50 pm

Re: php querystring

Post by besly98 »

all of it,.. im confused. can u write the code i should write?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: php querystring

Post by John Cartwright »

PCSpectra already did. It doesn't get any simpler than that. And reguardless, we arn't here to write the code for you. If you do not understand something you need to explain what you do not understand, and we will explain from there (and maybe a little code).
Post Reply