Page 1 of 1

DOH!

Posted: Mon Jul 05, 2004 3:55 am
by Chonk
Just posting to see what the most annoying error/problem you had was and how long it took to solve. Mine recently happend when i was checking 2 POST variables like this :

Code: Select all

<?php
if(!isset($_POST['uname']) && !isset($_POST['pass']))
{
  //FORMS
}
elseif(!isset($_POST['uname']) || !isset($_POST['pass']))
{
echo "Not all data entered please check";
}
elseif(isset($_POST['uname'] && isset($_POST['pass']))
{
 echo "Data entered";
}

?>
When only one variable was set "data entered" would be shown. It took me 4-5 days(after skating around the problem and coding something else ) before i realised what was wrong. I guessed that the POST variable must be setting some nullbyte value which isset would actually identify. A quick change to is_empty and I was done :D

Posted: Mon Jul 05, 2004 3:59 am
by feyd
redundant? :? :arrow: Annoying Poll

Posted: Mon Jul 05, 2004 12:41 pm
by d3ad1ysp0rk
elseif(isset($_POST['uname'] && isset($_POST['pass'])

You never closed the elseif.

Posted: Tue Jul 06, 2004 5:19 am
by Chonk
feyd: You are completly right, i should of read through a few pages first :oops:

LiLpunkSkateR: Your right about the code i posted but the code I had the problem with was the correct syntax.