Hi there,
There are two files : index.html and loanshark.php
the codes of index.html :
<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 the codes of loanshark.php
<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>
and the result I get :
You better pay me 0 every week, or else!
I had this kind of problem before and one of my friends told me to use $HTTP_POST_VARS and it solved to problem. I tried to understand the code and tried so many things with my knowledge about PHP thing but couldn't figure out how to use $HTTP_POST_VARS here. What is the solution of my problem? How will I use $HTTP_POST_VARS here or is there anything I should use different? If there is something different that I should use in this code what is it? Thanx for any help 😉