Re: [PHP] Php ignores if statement

2003-11-22 Thread Chris Shiflett
--- Pieter <[EMAIL PROTECTED]> wrote: > I recently started coding online and i have the weirdest response, > my code is: > > if ($id = "add" ) When you convert the string "add" to a boolean, it equates to true. I'm assuming you want to be using a conditional expression rather than an assignment

Re: [PHP] Php ignores if statement

2003-11-22 Thread John Nichel
Pieter wrote: I recently started coding online and i have the weirdest response, my code is: include 'function.inc'; echo "$id"; print (gettype($id)); if ($id = "add" ) { echo "is add"; exit; } '=' sets value. '==' checks equality. http://www.php.net/manual/en/language.operators.comp

Re: [PHP] Php ignores if statement

2003-11-22 Thread RT
On Sat, 2003-11-22 at 13:57, Pieter wrote: > I recently started coding online and i have the weirdest response, my code is: > > > include 'function.inc'; > > echo "$id"; > > print (gettype($id)); > > if ($id = "add" ) > > { > > echo "is add"; > > exit; > > } > > > if ($id = "own" ) >