Passing Vars over URL
Posted 13 October 2006 - 11:59 AM
I came up this problem today:
I tried to pass a variable to a script creating a URL like:
Unfortunately it appears $id is quite empty. Is there some setting I need to alter?
It used to work in the past (php4 that is).
Also, I don't have great access to the settings so is there also a workaround besides changing the ini file?
Thank you in advance!
Posted 13 October 2006 - 12:04 PM
The ?GET query string can be accessed with the SuperGlobal $_GET (Array)
<?php $id = $_GET["id"]; echo $id; ?>
This was changed because from earlier versions of PHP for security and performance concerns. POST vars are now stored in $_POST
NOTE: you can also turn on the 'old skool' methods in php.ini
Posted 13 October 2006 - 12:05 PM
to get the contents of id in the URL, use $_GET['id']
edit: beat me to it
I say old chap, that is rather amusing!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users