I need the php script to calculate the input data from a form and (-) or (+) the

hotgirlvick

New member
result… please help!!!? (HTML-Form)
<html>
<head>
<title>age1</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {
font-family: "Franklin Gothic Book";
font-size: 18px;
}
.style2 {font-family: "Franklin Gothic Book"}
-->
</style>
</head>
<body>
<form method="post" action="age.php">
<table width="267" height="267" border="1" align="center" bordercolor="#009999">
<tr bordercolor="#009999" bgcolor="#009999">
<td width="272" height="49" bordercolor="#009999" bgcolor="#009999"><span class="style11 style1">Unit 2 Project</span></td>
</tr>
<tr bordercolor="#009999">
<td height="181"><p align="left"><span class="style10 style2">Name:</span> <br />
<input name="Name" type="text" id="Name" value="" />
</p>
<p align="left"><span class="style10 style2">Age:</span> <br />
<input type="text" name="Age" id="Age" />
</p>
<p align="left">
<input type="submit" name="button" id="button" value="Submit" /></p>
</tr>
<tr bordercolor="#009933" bgcolor="#009999">
<td height="29" bordercolor="#009999" bgcolor="#009999"><label for="Age"></label>
<p align="left"></p>
</tr>
</table>
</form>
</p>
</body>
</html>

(PHP)
<?php
$_POST["Age"];
$_POST["Name"];
$_POST["retierment"];

if (($_POST["Age"] == "") || ($_POST["retierment"] == "") || ($_POST["Name"] == "")) {
header("Location: age.html"); exit;
}

if ($_POST["retierment"] > $_POST["Age"]) {
$result = $_POST["retierment"] - $_POST["Age"];
echo $_POST["Name"] ,
} else if ($_POST["Age"] < $_POST["retierment"]) {
$result = $_POST["retierment"] - $_POST["Age"];
<?php echo $_POST["Name"],
}
?>
<HTML>
<HEAD>
<TITLE>age</TITLE>
</HEAD>
<BODY>
<?php echo $_POST["Name"]; ?>,
<P>the number of years until you reach retirement age is: <?php echo "$result"; ?></P>
</BODY>
</HTML>
 
Back
Top