Why did they put ! as a possible evaluation/conditional if it is totally f' useless?
if (!$user) {
do something;
}
if (!isset($user)) {
do something;
}
These are analagous SOMETIMES but not ALL the time.
Took me 2 hours+ of screwing around and yelling at the computer to figure out that trusting any evaluation to ! alone is a good way to waste an afternoon.
Hopefully this serves as a warning to others.
I put this in the same category as the totally useless urlencode() and urldecode(). When dealing with spaces and periods in passing variables through URLs, use rawurlencode() and rawurldecode(). And even in this case, I ended up writing a function to convert spaces to %20 (And then had the nightmare of urlencode trying to change all my % symbols to %25)!!!
And don't get me started on the statement in the PHP manual that you don't need to use urlencode and urldecode in most cases because "the browser does it for you".
With the value maybe, but not with the variable name!
<form action="{$php_self}" method="POST">
<input name="DSCF4023.jpg" type="text" length="40">
<input name="Cool Photo.jpg" type="text" length="40">
<input name="submit" type="submit" value="Go!">
</form>
What you get back is total frickin gobbledygook!
Here's what $_POST comes out like:
$_POST = array(
'DSCF4023_jpg' => 'whatever',
'Cool%20Photo_jpg' => 'whatever');
God that killed me for an hour+ cause IE turns the %20 back into a space before you can see it so the problem was hidden.
Don't you love how IE interprets EVERYTHING as HTML even if no HTML headers have been sent? I guess you have to use <nohtml> 🙁
Sorry, just had to vent.