Jump to content

auspackuk

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by auspackuk

  1. THANK YOU FOR YOUR RESPONSE.hOWEVER, I HAVE APPLIED YOUR PROCEDURE BUT COULD NOT GET ANYTHING DISPLAYED FROM THE FORM. HOW FO YOU ADVISE THE WHOLE CODE SHOULD LOOK LIKE PLEASE? YOUR RESPONSE WILL BE APPRECIATED.
  2. Thanks for your response to my previous question. Your points on the open spaces in the between the equal sign and the value has been noted. However, i would want to say that the work "mess" could make someone who is new to this forum give up easily. How should the whole program look like to display the information needed? Should i separate the markup from the php script? Any tailed response will be appreciated from anybody. Regards.
  3. 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> MOD Edit: . . . tags added.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.