Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Andrew Jamison
September 13, 2009, 5:14 am
rate this thread
I am wanting to basically do an If statement that will check a cookie value
set from a form on the previous page. It will check to see if the variable
is blank if it is then it sets a new variable called $locked to 0 (actually
the #0 not just empty) if it contains text in the variable then the if
statement would set the $locked variable to 1
Here is what I have but it seems to error out saying invalid syntax and I am
not sure why.
$locked = "0" }
$locked = 1 } ?>
I am not sure if I am setting this wrong or not the $locked = "0" line I
have tried with and with out the ""
Any help would be appreciated
Re: If statement to check for blank cookie value and set a variable based on the output
Actually the "0" should work but might may have a problem down the road
if you do math since the quotes I believe make it a string, but he is
missing the semicolons after each internal statement.
Now PHP for the most part does a good job at switching types but not always.
"12345" is a string, 12345 is numerical.
Maybe someone can chime in if they wish to explain this is detail but
then its OT.