need help on a beginner php script tutorial?

Jake

New member
just started learning php using a tutorial. need help figuring out where to place the variable <font size="2">$cost
<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>

here is the php script
<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!";

}

<font color="#000000">YouOweMe($cost, $interest_rate);

?>

</body>
</html>

I am having a hard time placing the function, hopefully someone would be so kind as to help me.
thanks
just started learning php using a tutorial. need help figuring out where to place this variable <font size="2">$cost it needs this in order to establish the meaning of the variable $cost in the second script below


<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>

here is the php script
<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!";

}

<font color="#000000">YouOweMe($cost, $interest_rate);

?>

</body>
</html>

I
i just need to know how to get the second php script to read the information from the form in the html script and calculate it in the interest variable
 
<?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!";

}

<font color="#000000">YouOweMe($cost, $interest_rate);

?>


The <font.... is html, you can only have php between <?php ?> tags. If you want you could print the font out like
echo "<font color='#00000'>blahblah";

Also at the top you have
<font size="2">$cost
<html>

that cost variable wont be read by php because its not between the php tags <?php and ?>.

If you have any other problems feel free to post them on our site www.devhelpforums.com , it'd be appreciated!
 
Back
Top