note 99724 deleted from function.isset by danbrown

From: Date: Wed, 01 Sep 2010 15:54:42 +0000
Subject: note 99724 deleted from function.isset by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-172244@lists.php.net to get a copy of this message
Note Submitter: Lewis ---- I moved a website from one server to another and everything worked perfectly with the exception of a curious problem involving isset. Both websites were on servers running the same php version. The page was set up to detect whether a variable had been passed using the GET method and do one thing if the variable had been passed and another if it had not. I used isset() to check the variable. The script worked perfectly on the old server, but on the new server, it didn't detect the variable tacked on to the end of the URI. Here's a simplified version of the script for purposes of my question: <?php if (isset($test)) { $test = $_GET['test']; echo "Variable passed: " . $test; } else { echo "Variable not passed"; } ?> If I run this on the old server with the URI http://oldserver.com/index.php?test=1, it shows that the variable was passed, but when run on the new server, it doesn't. I realize that in the original scripting on the page, I should have used if (isset($_GET['test'])) but I was apparently feeling lazy that day and didn't notice the lack of proper scripting because it worked fine. My question, though, is what would make it work on the old server but not the new. A server setting perhaps? Any ideas?

« previous php.notes (#172244) next »