morning ..
struggiling with some if statements here... don't seem to be doing as they should, think maybe I'm overlooking something you guys may spot ...
In a cookie I have myid .. this is always a number I can display the myid on my page either just by typing $myid or by using the full $HTTP_COOKIE_VARS['myid']. Either way that works fine, and it always shows the correct myid.
The problem I have is my if statements do not take notice of the cookie variable .. I have ...
PHP Code:
if($status==2 AND $cid=='$myid'){ //here I just include a file }
if($status==3 AND $cid=='$myid'){ //here I have a html table with some text in }
if($status==3{ //here I have another include }
Now this is very strange .. the first if statement works fine, it only includes the file if status is 2 and the cid (this comes from a DB) is the same as myid, the cookie var.. that works great.. however the second if statement.. ALWAYS prints the table when status is 3... no matter what the cid and myid is, it will always print.. as if it is ignoring the AND.
The third if statement works fine too.
I have tried alterations of the if statements .. for example ...
PHP Code:
if($status==2 AND $cid==$myid){ //here I just include a file }
if($status==3 AND $cid==$myid{ //here I have a html table with some text in }
if($status==3{ //here I have another include }
and ...
PHP Code:
if($status=='2' AND $cid==$HTTP_COOKIE_VARS['myid']){ //here I just include a file }
if($status=='3' AND $cid==$HTTP_COOKIE_VARS['myid']){ //here I have a html table with some text in }
if($status=='3'{ //here I have another include }
. and it still does not work.. it never errors though.
Its very stange that the first if statement works and the second does not.
If anyone can see what I have done wrong, id be very greatful to hear
Thanks kindly,
Sir P