php - why the if else statement does not run the else statement? -
i have problem if , else statement in php never runs else statement.
the input form in html:
<input type="radio" name="marital_stat" id="single" value="single" />single <input type="radio" name="marital_stat" id="married" value="married" />married <input name="age" type="text" size="5" maxlength="3" placeholder="30" required/> <input name="work" type="radio" id="employee" value="employee" />employee <input name="work" type="radio" id="own" value="own" /> own business <input name="work" type="radio" id="jobless" value="jobless" />jobless <input name="place" type="radio" id="urban" value="urban" />urban <input name="place" type="radio" id="rural" value="rural" />rural</td> here php code:
if ($marital_stat == 'married') { if ($age >= 18 || $age < 59) { if ($work == 'jobless') { if ($place == 'rural') { $loan_credibility == 5; } } } } else if ($marital_stat == 'single') { if ($age >= 18 || $age < 59) { if ($work == 'employee') { if ($place == 'rural') { $loan_credibility == 1; } } } } here condition display output:
$a = 'positive'; $b = 'negative'; if ($loan_credibility == 5 ){ echo $b ;} else{ echo $a; }
as see make $loan_credibility == 5; or 1; == used in equality statement checks 2 sides if equal , have use = set value, not == $loan_credibility = 5; or 1;
Comments
Post a Comment