Php ignores if statement
| From: | Pieter | Date: | Sat, 22 Nov 2003 18:57:09 +0000 |
| Subject: | Php ignores if statement | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-170680@lists.php.net to get a copy of this message | ||
I recently started coding online and i have the weirdest response, my code is:
<?php
include 'function.inc';
echo "$id<br>";
print (gettype($id));
if ($id = "add" )
{
echo "is add";
exit;
}
if ($id = "own" )
{
echo "id is own";
exit;
}
if ($id = "all" )
{
echo "id is all";
exit;
}
?>
$id in this case = "own", but it totally ignores this value and uses the first if
statement and treats $id as if it has a value of "add". I am very frustrated and i really
hope someone can help me. The server is linux, and php version 4.1.2
Thanks