Just found the problem, the if, else-if, else statement work okay when it is
too many.  The reason it doesn't work is because there's a loophole in the
script due to someone's flaw logic or haven't thought about it when
brainstorming...

Thanks,
 Scott

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am seeing the problem now.  It seem that it had to do with the 'OR'
> statement inside the elseif statement...  I'm going to try a workaround to
> it...  As for you mentioning about the code...  It's too bad this message
> window doesn't properly display the tabs....
>
> --clip--
> if ($firstname == \"\") {echo \"Enter [First Name]\"; return false;}
>
> elseif ($lastname == \"\") {echo \"Enter [Last Name]\"; return false;}
>
> elseif ($address == \"\") {echo \"Enter [Address]\"; return false;}
>
> elseif ($city == \"\") {echo \"Enter [City]\"; return false;}
>
> elseif ($state == \"\") {echo \"Enter [State]\"; return false;}
>
> elseif ($zipcode == \"\") {echo \"Enter [Zip Code]\"; return false;}
>
> elseif ($homephoneno == \"\") {echo \"Enter [Home Phone #]\"; return
false;}
>
> elseif ($dob == \"\") {echo \"Enter [Date of Birth]\"; return false;}
>
> elseif ($ssn == \"\") {echo \"Enter [Social Security No]\"; return false;}
>
> elseif ($dln == \"\") {echo \"Enter [Driver\'s License No]\"; return
false;}
>
> elseif ($occupation == \"\") {echo \"Enter [Occupation]\"; return false;}
>
> elseif ($months == \"\") {echo \"Enter [Residence Months]\"; return
false;}
>
> elseif ($rentown == \"Renting\" || $rentown == \"Lease\" || $rentown ==
> \"Buying House W/Mortgage\") {
>
> /*
>
> if ($towhompaid == \"\") {echo \"Enter [To Whom Paid]\"; return false;}
>
> elseif ($paymentaddress == \"\") {echo \"Enter [Home Payment Address]\";
> return false;}
>
> elseif ($paymentcity == \"\") {echo \"Enter [Home Payment City]\"; return
> false;}
>
> elseif ($paymentstate == \"\") {echo \"Enter [Home Payment State]\";
return
> false;}
>
> elseif ($paymentzipcode == \"\") {echo \"Enter [Home Payment Zip Code]\";
> return false;}
>
> */
>
> }
>
> /*
>
> elseif ($income == \"\") {echo \"Enter [Income]\"; return false;}
>
> elseif ($typeofincome == \"\" && $otherincome > 0) {echo \"Enter [Type of
> Income]\"; return false;}
>
> elseif ($bankname == \"\") {echo \"Enter [Bank Name]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jlastname == \"\") {echo \"Enter
Cobuyer\'s
> [Last Name]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jaddress == \"\") {echo \"Enter Cobuyer\'s
> [Address]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jcity == \"\") {echo \"Enter Cobuyer\'s
> [City]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jstate == \"\") {echo \"Enter Cobuyer\'s
> [State]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jzipcode == \"\") {echo \"Enter Cobuyer\'s
> [Zip Code]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jhomephoneno == \"\") {echo \"Enter
> Cobuyer\'s [Home Phone #]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jdob == \"\") {echo \"Enter Cobuyer\'s
[Date
> of Birth]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jssn == \"\") {echo \"Enter Cobuyer\'s
> [Social Security No]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jdln == \"\") {echo \"Enter Cobuyer\'s
> [Driver\'s License No]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Joccupation == \"\") {echo \"Enter
> Cobuyer\'s [Occupation]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jmonths == \"\") {echo \"Enter Cobuyer\'s
> [Residence Months]\"; return false;}
>
> elseif ($Jfirstname != \"\" && ($Jrentown == \"Renting\" || $Jrentown ==
> \"Lease\" || $Jrentown == \"Buying House W/Mortgage\")) {
>
> if ($Jfirstname != \"\" && $Jtowhompaid == \"\") {echo \"Enter Cobuyer\'s
> [To Whom Paid]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jpaymentaddress == \"\") {echo \"Enter
> Cobuyer\'s [Home Payment Address]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jpaymentcity == \"\") {echo \"Enter
> Cobuyer\'s [Home Payment City]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jpaymentstate == \"\") {echo \"Enter
> Cobuyer\'s [Home Payment State]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jpaymentzipcode == \"\") {echo \"Enter
> Cobuyer\'s [Home Payment Zip Code]\"; return false;}
>
> }
>
> elseif ($Jfirstname != \"\" && $Jincome == \"\") {echo \"Enter Cobuyer\'s
> [Income]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jtypeofincome == \"\" && $Jotherincome >
0)
> {echo \"Enter Cobuyer\'s [Type of Income]\"; return false;}
>
> elseif ($Jfirstname != \"\" && $Jbankname == \"\") {echo \"Enter
Cobuyer\'s
> [Bank Name]\"; return false;} */
>
> else
>
> return $returnvalue = \"Pass\";
>
> --clip--
>
>
>
> "Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> [snip]
> Noticed something interesting.  I was helping to debug someone's
> programming problem and found that if there is to many 'else if' in the
> if
> and else statement then it doesn't work.  Have anyone encoutered this
> problem and know of a workaround to it?
> [/snip]
>
> I'd have to see the code
>
> Jay
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to