Canadian Webhosting Forums Forum Index Canadian Webhosting Forums
Discussion Forums
 
 FAQFAQ   SearchSearch      RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Handling variable in URL

 
Post new topic   Reply to topic    Canadian Webhosting Forums Forum Index -> PHP
Author Message
coolaj



Joined: 28 Jan 2008
Posts: 1

PostPosted: Mon Jan 28, 2008 9:27 pm    Post subject: Handling variable in URL Reply with quote

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.
Back to top
sanoop
Guest





PostPosted: Tue Jan 29, 2008 11:19 pm    Post subject: Reply with quote

Quote:



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.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Canadian Webhosting Forums Forum Index -> PHP All times are GMT - 8 Hours
Page 1 of 1

 


Hosting Plans :: Flash Tutorials :: Contact Us :: Privacy Policy


Powered by phpBB, MySQL and PHP