Handling variable in URL

Handling variable in URL

Postby coolaj » Mon Jan 28, 2008 10:27 pm

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.
coolaj
 
Posts: 1
Joined: Mon Jan 28, 2008 10:25 pm

Postby sanoop » Wed Jan 30, 2008 12:19 am



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.
sanoop
 


Return to PHP

Who is online

Users browsing this forum: No registered users and 3 guests

cron