Jump to content
xisto Community
Sign in to follow this  
HmmZ

Elseif Statement Not Doing The Right Thing

Recommended Posts

elseif ("$username=''.$password=''.$fullname=''.$country=''.$email=''") {	print "<table border='0' align='center' valign='center' width='400' height='400'><tr><td align='center'><font size='2'><b>You did not fill out all the fields</b><br><A HREF='javascript:history.back()'><img src='http://forums.xisto.com/no_longer_exists/; border='0'></A></td></tr></table>";}

whats wrong with this statement, I did fill everything out and it still gives the error? :)

Share this post


Link to post
Share on other sites

This should do the job:


elseif ($username == '' || $password == '' || $fullname == '' || $country == '' || $email == '')

Why don't you check this online book on php programming called Practical PHP Programming.. It is free and I'm sure you could have found something on the syntax of the (else)if conditional statement. I've looked it up, check This chapter for more information.


Share this post


Link to post
Share on other sites

The statement is doing exactly what it should do. It's funny how people will blame anything/anyone other than themselves.HmmZ, in PHP, a period is used to join two variables or add data to an existing variable. Because you have enclosed the condition in quotes, it would become exactly what you see (with the variables replaced by their respective values).

Share this post


Link to post
Share on other sites

It was actually a questioning statement rather then just a plain statement, as ive mentioned before im a noob in php...

It's funny how people will blame anything/anyone other than themselves.

so NO need to say that, first read right before judging like that...

second, it was solved so why dig the thread up again, you'll only get other threads down in the list...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.