Plz Help regarding simple coding
Posted: Tue Feb 24, 2009 1:11 am
plz check my following code and tell me is there any error in it when i run it on my local mechine using WAMPSERVER it gives follwing error
but online it run smoothly http://waqar.w4wallpapers.com//loan.php
plz tell me where i m doing wrong??
here is code of that programe
Code: Select all
Notice: Undefined variable: salary in C:\wamp\www\loan.php on line 31
Notice: Undefined variable: age in C:\wamp\www\loan.php on line 32
Notice: Undefined variable: age in C:\wamp\www\loan.php on line 32
Notice: Undefined variable: loan in C:\wamp\www\loan.php on line 34
Loan Wanted:
Loan Amount We Will Allow U:0
Notice: Undefined variable: loan in C:\wamp\www\loan.php on line 37
Notice: Undefined variable: fname in C:\wamp\www\loan.php on line 38
Notice: Undefined variable: lname in C:\wamp\www\loan.php on line 38
Congrates. , We r delighted to offer u loan
Notice: Undefined variable: loan in C:\wamp\www\loan.php on line 40
plz tell me where i m doing wrong??
here is code of that programe
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hello!</title>
</head>
<body>
<center><h1>Meezan Bank Loan Application Form</h1></center>
<form action="loan.php">
<b>First Name:</b> <Input type="Text" name="fname" />
<b>Last Name:</b> <Input type="Text" name="lname" />
<b>Age:</b> <Input type="Text" name="age" Size="3"/><br /><br />
<b>Address:</b> <textarea name="ads" rows="4" cols="40"></textarea><br /><br />
<b>Wht Is Ur Current Salary?</b> <select name="salary">
<option value="0">Less Then $10,000</option>
<option value="10000" >$10,000 To $25,000</option>
<option value="25000">$25,000 To $50,000</option>
<option value="50000">over $50,000</option>
</select><br /><br />
<b>How Much Loan U Want:</b> <br /><input type="radio" name="loan" value="1000"/>Our $1,000 Package @ 8.0% Interest<br />
<input type="radio" name="loan" value="5000"/>Our $5,000 Package @ 11.5% Interest<br />
<input type="radio" name="loan" value="10000"/>Our $10,000 Package @ 15.0% Interest<br />
<input type="submit" value="Click Here To Submit Loan Applicaton" />
<input type="reset" value="Click Here To Reset" />
<?php
$salaryall=$salary/5;
$ageall=($age/10 - ($age%10)/10)-1;
$loanall=$ageall * $salaryall;
print "<br><br><b>Loan Wanted:</b>$loan";
print "<br><br><b>Loan Amount We Will Allow U:</b>$loanall<br><br>";
if ($loan <= $loanall)
print "Congrates. $fname $lname, We r delighted to offer u loan";
if ($loan > $loanall)
print "Sorry $fname $lname, We cannt offer u loan at this time";
?>
</form>
</body>
</html>