getting information from the url.

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
RedRasper
Forum Commoner
Posts: 48
Joined: Thu Apr 24, 2003 6:36 am

getting information from the url.

Post by RedRasper »

Hi, is it possible to get information from url, for example http://www.xxx.com/test.php?firstchoice ... hoice=xxxx ?

I've had a scout of the manual, but haven't found it, so if someone can point me in that direction or tell I would be greatful.

Thanks

RedRasper
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

if that is the URL that is calling the page, then all of the details after the ? will be available in $_GET variables with the & starting the beginning of the next variable. The URL will produce the following variables :

$_GET["firstchoice"] will = xxxx
$_GET["secondchoice"] will = xxxx


Hope thats what you were looking for?
RedRasper
Forum Commoner
Posts: 48
Joined: Thu Apr 24, 2003 6:36 am

Post by RedRasper »

Hi,

Yeah thats what I'm after. Just a check, can I just enter that as a url in say a web broswer and still get at that information?

Cheers

RedRasper
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

Of course if you are ahead of yourself and are thinking, "well doesn't that make my site grossly insecure" yes it does! ys the quick answer. BUT may i suggest you look into sessions, sessions validate if a user is indeed allowed to view the content, if not he will not be able to see the content even if he types it in the url of the browser.
RedRasper
Forum Commoner
Posts: 48
Joined: Thu Apr 24, 2003 6:36 am

Post by RedRasper »

Hi,

Thanks for the information, I'll look into the security side of things!

RedRasper
Post Reply