Forum Moderators: coopster
<html>
<head>
<title>vSignup 2.5</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?
$username="";
$password="";
$database="ourbanke_ourbanker";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query2="SELECT * FROM income";
$result=mysql_query($query2);
$combine=mysql_result($result,"combine");
// mysql_close();
$amount = $_POST["amount"];
$marketvalue1 = "$amount" * 0.80;
$maxloan1 = $_POST["maxloan"];
$maxloan2 = $_POST["maxloan"] * 0.70;
$amtdesired1 = $_POST["amtdesired"];
$ratio = "$maxloan1" / "$amtdesired1";
$months = $_POST["months"];
$interest = $_POST["interest"];
$ratedec = $_POST["interest"] * "0.01";
$percent = "$ratedec" / $_POST["months"];
$total1 = $_POST["amtdesired"] * "$percent";
$expo1 = "1.00" + "$percent";
$counter = "1.00";
$expo2 = "$expo1" * "$expo1";
$expo3 = "$expo2";
$months2 = $_POST["months"] - 1;
while ( $counter < "$months2" ){
$expo3 = "$expo3" * "$expo1";
$counter = "$counter" + "1.00";
}
$rate1 = "1.00" / "$expo3";
$rate2 = "1.00" - "$rate1";
$total5 = "$total1" / "$rate2";
$ratio2 = "$total5" / "$combine";
$ratio3 = "$ratio2" * 100;
$query = "INSERT INTO tempbank VALUES ('','$amount','$maxloan1','$amtdesired1','$months','$interest','$marketvalue1','$maxloan2','$amtdesired1','$ratio','$total5','$ratio3')";
mysql_query($query);
mysql_close();
if ( $ratio >= 1.0 ) {
$score1 = "SATISFACTORY";
$advisory1 = " ";
$advisory2 = " ";
} else {
$score1 = "UNSATISFACTORY";
$advisory1 = "Sorry. Amount desired must be not exceed maximum loan value.";
$URL="http://www.example.net/index.php";
header("Location: $URL");
exit;
}
?>
</body>
</html>
[edited by: eelixduppy at 5:07 am (utc) on Sep. 19, 2007]
[edit reason] exemplified [/edit]
header("Location: $URL");
You can't send headers that way, if you have any output to the browser on the lines ahead of this line.
Collect all the outputs (including html and spaces) you have into a variable, and echo it only when needed and not before that line sending headers.
Habtom