Bug #10908 Updated: Undeclared variables/URL declared variables
| From: | derick@php.net | Date: | Wed, 16 May 2001 21:07:02 +0000 |
| Subject: | Bug #10908 Updated: Undeclared variables/URL declared variables | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-55536@lists.php.net to get a copy of this message | ||
ID: 10908
Updated by: derick
Reported By: jpmaster77@hotmail.com
Old-Status: Open
Status: Bogus
Bug Type: Scripting Engine problem
Operating system:
PHP Version: 4.0.5
Assigned To:
Comments:
This is not a bug.
1. Use:
if ($id == "view")
= : assignment
== : comparison
2. You can change your errorlevel, which is causing these
messages, see www.php.net/error_reporting
Previous Comments:
---------------------------------------------------------------------------
[2001-05-16 16:56:04] jpmaster77@hotmail.com
Ok, I ran this script on my Apache server with the new PHP 4.0.5 installed and it did not work...
<?
if($id="view"){
echo "You are in view mode";
}
else{
echo "You are not in view mode";
?>
<br>
<form action="?id=view" method="post">
<input type="submit" value="Change to View Mode">
</form>
<?
}
?>
When you first view the page, it says "You are not in view mode" and has a submit button
that says "Change to View Mode". If you click to button it will give $id the value of
"view", so when it reloads the page, it will display "You are in view mode".
This script works fine on my server with the earlier version of PHP, but not with 4.0.5. The new
version 4.0.5 returns an error the first time it loads an says that $id hasnt been defined.
I dont know if they changed it on the new version because they thought it was a bug of the old
versions(that didnt return errors for undeclared variables), but if thats the case, they certainly
disabled simple scripts like this one that made things a hell of a lot easier for us programmers.
Thats why I'm using the old version of PHP, and not PHP 4.0.5 on my Apache server.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10908&edit=2