Page 1 of 1
debug help with statement?
Posted: Fri Jan 28, 2005 8:40 am
by mmc01ms
can anyone see whats wrong with this statment it returns no error just a white screen when those fields are not entered?
statment is:
Code: Select all
if((!isset($_POSTї'story'])) || (!isset($_POSTї'headline'])))
{
error_message("Enter all fields");
}
Posted: Fri Jan 28, 2005 8:42 am
by JayBird
think you may be better doing this
Code: Select all
if((empty($_POSTї'story'])) || (empty($_POSTї'headline'])))
{
error_message("Enter all fields");
}
becuase even if the user doesn't enter them field, the POST values are still set
Posted: Fri Jan 28, 2005 8:53 am
by mmc01ms
cheers for that however the script doesn't like the syntax of that code this is what i give it
Code: Select all
if((empty($_POSTї'story'])) || ((empty($_POSTї'headline']))
{
error_message("Enter all fields");
}
error is:
Code: Select all
Parse error: parse error, unexpected '{' in /home/sites/manpreetsandhu.com/public_html/article_submit.php on line 32
Posted: Fri Jan 28, 2005 8:56 am
by feyd
you're missing a closing paren... come on now..
edit: darn spelling.
Posted: Fri Jan 28, 2005 8:58 am
by JayBird
i think what my good friend feyd is saying is it shoule be this
Code: Select all
if((empty($_POSTї'story'])) || ((empty($_POSTї'headline'])))
{
error_message("Enter all fields");
}
Posted: Fri Jan 28, 2005 9:17 am
by mmc01ms
doeswn't matter which way i put it it's the same error it doesn't like the braces?
Code: Select all
if((empty($_POSTї'story'])) || ((empty($_POSTї'headline']))) {
error_message("Enter all fields");
}
Posted: Fri Jan 28, 2005 9:19 am
by feyd
your code is still missing a closing paren. Count the parens.
Posted: Fri Jan 28, 2005 9:50 am
by JayBird
ive spotted it!!! have you!?!?

Posted: Fri Jan 28, 2005 9:56 am
by mmc01ms
yes sorry im having a nightmare day today! It just comes up with another error now something about Boolean. I'll check it out later. cheers guys