954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

If else not working

I'm trying to build a mortgage qualifying script for a company. My php code is working fine .. up until the if else statements. fyi I'm using wamp... heres the code. The code if very raw, i've only been working on it for a day or 2, but I can't understand why my if else statements aren't working.

index.htm

<html>

<body>
<h1>Lead Capture</h1>
<div id = "leadcapture">
             <form method="post" action="process.php"> 
              Name: <input name="name" type="text" STYLE="background: white; border: 1px #CACACA solid;"><br >

              Phone:<input name="phone" maxlength="13" size="13" type="text" STYLE="background: white; border: 1px #CACACA solid;"><br >

              Email: <input name="email" type="text" STYLE="background: white; border: 1px #CACACA solid;"><br >

              Market Value or Purchase Price of Property:<br ><input name="value" type="text" maxlength="9" size="10" STYLE="background: white; border: 1px #CACACA solid;"><br >

	<b><u>Loan Amount:</b></u>
	Purchase: Loan amount after down payment.
	Refinance: Payoff.
	Refinance (Cashout): Payoff + cash requesting.<input name="payoff" maxlength="9" size="10" type="text" STYLE="background: white; border: 1px #CACACA solid;"><br >

	Current Interest Rate(if applicable):<br ><input name="rate" type="text" maxlength="5" size="5" STYLE="background: white; border: 1px #CACACA solid;"><br >
	
	Estimated Credit Score: <select name="credit">
		<option value=">740">>740</option>
		<option value="739-720">739-720</option>
		<option value="719-700">719-700</option>
		<option value="699-680">699-680</option>
		<option value="679-660">679-660</option>
		<option value="659-640">659-640</option>
		<option value="639-600">639-600</option>
		<option value="<600"><600</option>
		</select>
	
	Refinance or Buy:<select name="buysell">
		<option value="buy">Buy</option>
		<option value="refinance">Refinance</option>
		<option value="cashout">Refinance-Cashout</option>		
		</select>



	<input type="submit" name="go" value="submit"> 
	
	</form>
</div>
</body>
</html>


process.php

<?php
$name=$_POST['name'];
$phone=$_POST['phone'];
$email=$_POST['email'];
$payoff=$_POST['payoff'];
$value=$_POST['value'];
$rate=$_POST['rate'];
$credit=$_POST['credit'];
$buysell=$_POST['buysell'];

$number=($payoff/$value)*100;

echo "Name:  $name";
echo "Phone: $phone";
echo "Email: $email";
echo "Payoff: $payoff";
echo "Market Value: $value";
echo "Current Interest Rate:  $rate";
echo "Estimated Credit Score: $credit";
echo "You want to $buysell a property";

echo"$number %";

if($buysell=="Refinance - Cashout"){
	if($number >= 96.5){
		echo "Your Loan to Value Ratio is too high to Receive any cash out or to  refinance ";
	}elseif($number < 96.5 && $number > 80 ) { 
		echo "Your Loan to Value Ration is too high to receive any cash out but you are still able to refinance your property.";
	}else{
		echo "Prior to any closing costs being subtracted your estimated cash back is $cashback.";
	}
}
?>
RazorRamon
Junior Poster in Training
74 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
 
<option value="cashout">Refinance-Cashout</option>
$buysell=="Refinance - Cashout"


That doesn't match.
Should be

$buysell=="cashout"
Insensus
Junior Poster
112 posts since Mar 2011
Reputation Points: 70
Solved Threads: 46
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: