PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
mmc01ms
Forum Commoner
Posts: 97 Joined: Wed Dec 01, 2004 3:33 am
Location: Nottingham, UK
Post
by mmc01ms » Fri Jan 28, 2005 8:40 am
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");
}
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Fri Jan 28, 2005 8:42 am
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
mmc01ms
Forum Commoner
Posts: 97 Joined: Wed Dec 01, 2004 3:33 am
Location: Nottingham, UK
Post
by mmc01ms » Fri Jan 28, 2005 8:53 am
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
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Jan 28, 2005 8:56 am
you're missing a closing paren... come on now..
edit: darn spelling.
Last edited by
feyd on Fri Jan 28, 2005 9:00 am, edited 1 time in total.
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Fri Jan 28, 2005 8:58 am
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");
}
mmc01ms
Forum Commoner
Posts: 97 Joined: Wed Dec 01, 2004 3:33 am
Location: Nottingham, UK
Post
by mmc01ms » Fri Jan 28, 2005 9:17 am
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");
}
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Jan 28, 2005 9:19 am
your code is still missing a closing paren. Count the parens.
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Fri Jan 28, 2005 9:50 am
ive spotted it!!! have you!?!?
mmc01ms
Forum Commoner
Posts: 97 Joined: Wed Dec 01, 2004 3:33 am
Location: Nottingham, UK
Post
by mmc01ms » Fri Jan 28, 2005 9:56 am
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