[PHP] Php ignores if statement

2003-11-22 Thread Pieter
I recently started coding online and i have the weirdest response, my code is: ?php include 'function.inc'; echo $idbr; 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

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: ?php include 'function.inc'; echo $idbr; print (gettype($id)); if ($id = add ) { echo is add; exit; } if ($id = own ) { echo id is

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: ?php include 'function.inc'; echo $idbr; print (gettype($id)); if ($id = add ) { echo is add; exit; } snip '=' sets value. '==' checks equality.

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