note 99724 added to function.isset
| From: | Lewis at osu1 dot php dot net | Date: | Wed, 01 Sep 2010 15:44:59 +0000 |
| Subject: | note 99724 added to function.isset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-172243@lists.php.net to get a copy of this message | ||
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?
----
Server IP: 69.147.83.197
Probable Submitter: 67.76.93.77
----
Manual Page -- http://www.php.net/manual/en/function.isset.php
Edit -- https://master.php.net/note/edit/99724
Del: integrated -- https://master.php.net/note/delete/99724/integrated
Del: useless -- https://master.php.net/note/delete/99724/useless
Del: bad code -- https://master.php.net/note/delete/99724/bad+code
Del: spam -- https://master.php.net/note/delete/99724/spam
Del: non-english -- https://master.php.net/note/delete/99724/non-english
Del: in docs -- https://master.php.net/note/delete/99724/in+docs
Del: other reasons-- https://master.php.net/note/delete/99724
Reject -- https://master.php.net/note/reject/99724
Search -- https://master.php.net/manage/user-notes.php