http://members.lycos.co.uk/jibfyb/
Select an item in the dropdown menu and you will see the URL change to "http://members.lycos.co.uk/jibfyb/index ... eryouchose".
Now, in that textarea box (which currently says '<span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>'...) I have this code:
if($map == cat){ print("Hah!"); } else { print("<span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>!"); }
So, choose cat in the dropdown menu.
The textarea box STILL says '<span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>'.
How do I make sure $map is seen throughout the page as whatever has been selected in the drop box?
Thanks!
Passing variables thru a URL
Moderator: General Moderators
Re: Passing variables thru a URL
Okay, this looks like your problem. You don't pass a query string like that. You need to start the query string with '?', and then just have the name of the variable (no $ sign.) Such as:
http://members.lycos.co.uk/jibfyb/index.php?map=cat
If you have global variables turned on you can then access it with $map in the script (once submitted), or with $_GET/$_POST, depending on the method of your form.
If you want more than one vairable you'd serperate up the variable/data pair with &, such as:
index.php?map=cat&name=scratch&colour=tan
Andy
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
To access the map variable with register_globals turned off you'd use,
Mac
Code: Select all
$_GETї'map']