Page 1 of 1

Handling variable in URL

PostPosted: Mon Jan 28, 2008 10:27 pm
by coolaj
Now, I have difficulties in understanding why PHP works in such a strange way. It does not bring variables from the URL.

For example, I wrote a test script (test.php) and placed it on the root of my web site:



<?php



if (isset($var))

{

echo "The variable \$var is set to ".$var;

}

else

{

echo "The variable \$var is not set";

}



phpinfo();

?>



By going to URL test.php I would expect to see line like: The variable $var is not set.

And this is fine.



By going to URL test.php?var=2 I would expect to see line like: The variable $var is set to 2.

But instead I see the same result.



Please advice.

PostPosted: Wed Jan 30, 2008 12:19 am
by sanoop


Hi,

We have turned on register_globals for your website.
http://entrepreneurnetwork.ca/p.php

It will help you to sort out the variables problem

Thanks.