PHP Classes

PHP Question on how to get data displyed

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  PHP Question on how to get data displyed  
Subject:PHP Question on how to get data displyed
Summary:How to i get my values displayed from the cal price button
Messages:3
Author:bikes
Date:2011-01-22 13:08:35
Update:2011-02-26 22:41:57
 

  1. PHP Question on how to get data displyed   Reply   Report abuse  
Picture of bikes bikes - 2011-02-24 08:46:41
Please how do i get my result displayed when i cilck on the calcluate price button. Hould i separate the codes to make sure my values are displayed accurately. The whole code is here:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dynamic Page</title>
</head>

<body>

<FORM METHOD = "POST" ACTION = "cal_price_form.php">

<FONT FACE ="Verdana" COLOR = "#1200FF">
<CENTER><B><H2> A program that calculates the cost of a product</H2></B></CENTER>
</font>
<br>
<br>

<?php
//Print todays date on the screen

$finddate= date("j-m-y");

echo "<h2>$finddate</h2>";


?>

Please type in the type of product
<INPUT TYPE = "TEXT NAME" =" product_type" maxlength=10 SIZE =10 ><br>
Please type in the name of the product
<INPUT TYPE = "TEXT NAME" =" product_name" maxlength=35 SIZE =35 ><br>
Please type in the cost of the product
<INPUT TYPE = "TEXT NAME" ="original_price" MAXLENGHT = 5 SIZE = 5>

<p>
<INPUT TYPE ="Submit" VALUE="Calculate price">

<?php
function calculate($original_price){

return $finalprice=($original_price * 0.16)+ $original_price;
}

echo"<br><h2><center>The type of product is:$product_type</center></h2>";
echo"<br><h2><center>The name of the product is:$product_name</center></h2>";
echo "<br><h2><center>The final price of the product is:".calculate($original_price)."</center></h2>";
?>

</body>
</html>

There are 2 replies in this thread, which are not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.