Jul 6, 2008

Elseif Statement Not Doing The Right Thing

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

Elseif Statement Not Doing The Right Thing

HmmZ
CODE

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://www.online.trap17.com/images/go_backbutton.gif' border='0'></A></td></tr></table>";
}


whats wrong with this statement, I did fill everything out and it still gives the error? sad.gif

Reply

Carsten
This should do the job:
CODE
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.

Reply

Spectre
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).

Reply

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

QUOTE
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...

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : elseif, statement, thing

  1. What Is Wrong With This Php-sql Select Where Statement?
    (5)
  2. Complex Php Echo Statement Assistance
    Can't quite get this one, help appreciated (3)
    Can someone help me out with this one, please. I have a PHP script in which I am trying to write a
    fairly complex piece of html and I can't seem to get the coding of the PHP echo statement.
    There are single and double quotes scattered throughout this line of html and it is driving me nuts
    attempting to manage the output. So far, the only way I can get it to work is to break the
    echo'ing of the line of html code into the following lines of PHP: HTML echo "\t" ;
    echo ' li > a href ="'; echo $full_dir . $file ; echo '" alt=" full-s....
  3. Calling A Variable From A Dynamic List In A Sql Statement
    (2)
    I would be greatful if anyone could help me out, I have been stuck on this for a while. The problem
    is that I have a drop down menu which I get the contents of from a database. Then when I press the
    get details button I want to use the value selected in my drop down menu and pass it into an SQL
    statement to recieve all te relevent info. Everything works if I specify a known variable, but the
    problem seems to be passing a variable in which is part of the array. Below is the code for the drop
    down menu and the Sql statement i'm trying to execute. drop down menu: �....
  4. Possible To Put An If Statement Inside A Variable?
    (2)
    Ok, so I'm using the include() function on my website. Problem is I'm trying to include a
    search engine form into the layout which is stored in a variable, except the form has an if
    statement in it and I can't seem to get it working. Here's the code I'm trying to
    include... CODE Search: > Just wondering if it is possible for me to put this
    form with the if statement into a variable, or if there's another way that I could go about
    doing this. Thanks.....

    1. Looking for elseif, statement, thing

Searching Video's for elseif, statement, thing
advertisement



Elseif Statement Not Doing The Right Thing



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE