Page 1 of 1

php querystring

Posted: Sun Feb 22, 2009 5:53 pm
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

Re: php querystring

Posted: Sun Feb 22, 2009 6:07 pm
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

Re: php querystring

Posted: Sun Feb 22, 2009 6:19 pm
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?

Re: php querystring

Posted: Sun Feb 22, 2009 6:29 pm
by John Cartwright
Moved to PHP-Code.

Re: php querystring

Posted: Sun Feb 22, 2009 6:45 pm
by besly98
sorry that not make sense

Re: php querystring

Posted: Sun Feb 22, 2009 6:53 pm
by John Cartwright
What doesn't make sense?

Re: php querystring

Posted: Sun Feb 22, 2009 6:56 pm
by besly98
all of it,.. im confused. can u write the code i should write?

Re: php querystring

Posted: Sun Feb 22, 2009 6:58 pm
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).