getting this form to work
Posted: Sun Mar 27, 2005 5:15 am
ok here is my codes
but i get the following error when i try and view it in my local host
Notice: Undefined variable: cost in c:\program files\installedprograms\easyphp1-8\www\loanshark.php on line 20
You better pay me $0 every week, or else!
anybody no what im doing wrong anyhelp would be excellent thanks
feyd | Please review how to post code using
Code: Select all
<html>
<head>
<title>"You Better Pay Up" Loan Services</title>
</head>
<body>
<center>
<h3>Welcome to "You Better Pay Up" Loan Services</h3>
You pay us ten percent every week, or else.
<form action="loanshark.php" method=post>
My hovercraft costs $<input type="text" name="cost">
<p><input type="submit" name="submit" value="What's My Interest Payment?">
</form>
</center>
</body>
</html>
and here is my form page
<html>
<head>
<title>Loans</title>
</head>
<body>
<?php
$interest_rate = .14;
function YouOweMe($cost, $interest_rate) {
$weekly_payment = ($cost*$interest_rate);
print "You better pay me \$$weekly_payment every week, or else!";
}
YouOweMe($cost, $interest_rate);
?>
</body>
</html>Notice: Undefined variable: cost in c:\program files\installedprograms\easyphp1-8\www\loanshark.php on line 20
You better pay me $0 every week, or else!
anybody no what im doing wrong anyhelp would be excellent thanks
feyd | Please review how to post code using
Code: Select all
andCode: Select all
tags. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]