using IIS, variables won't pass from link

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
tbbd
Forum Newbie
Posts: 20
Joined: Sat Apr 22, 2006 2:54 pm

using IIS, variables won't pass from link

Post by tbbd »

i have very simple script that just passes variable from one page to another in the link

contents of page1.php

Code: Select all

<?php
$value = 1;
echo "<a href=\"page2.php?value=$value\">Link</a>";
?>
contents of page2.php

Code: Select all

<?php
echo "value is: " .$value;
?>
I upload to a webhost that I have a site on and it works great
I keep it on my pc (wxp with IIS and php4) and run from localhost, the value does not get passed over. Nothing is displayed as $value.
After reading other forums where people had similar issues (although theirs was always from a form), I set register_globals=On in my php.ini, that didn't help either. It has to be something with the configuration of either php or IIS
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

you have register globals OFF on your local host...which is a good thing ( you should tell your provider to turn it off too ;) )

try echoing

Code: Select all

echo "value is: ".$_GET['value'];
tbbd
Forum Newbie
Posts: 20
Joined: Sat Apr 22, 2006 2:54 pm

Post by tbbd »

like I said in the first post, I did turn register globals On, but ti didn't help, so now I have turned it Off, then did the $_GET as you suggested and it works great...
now, I have this on my localhost to design the pages first, then I upload them to the webserver when all is ready, will it hurt to leave all the $_GET and $_POST info in there to put on the host or will I need to change it when I do that?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

nope...leave them as separate arrays...it will work on your dev (local server) and host just fine.

really your host should turn them off.
tbbd
Forum Newbie
Posts: 20
Joined: Sat Apr 22, 2006 2:54 pm

Post by tbbd »

thanks for all your help...I'll send an email to them and suggest that to them
Post Reply