Jump to content

help - new at php


dinga301124

Recommended Posts

hey, very new at all this wondering if anyone could help me out. using php I want the form to display the cost of a pizza when the user chooses a radio button (Small, Large or medium), selects any extras using checkboxes (olives, tomato,beef,pineapple, ham, capsicum) and then hits the submit button. When small pizza = $5 medium pizza = $7 large pizza = $10 and all extras are $2 each.

 

this is my form:

 

<body>

 

<form action="price.php" method="POST">

 

<p>Pizza size:</p>

 

<p><input type="radio" name="size" id="small" value="small"

/> <label for="small">small</label><br />

<input type="radio" name="size" id="medium" value="medium"  />

<label for="medium">medium</label><br />

<input type="radio" name="size" id="large" value="large"  />

<label for="large">large</label><p>

 

 

<p>Optional extras:</p>

 

<p><input type="checkbox" name="extras[]" id="olives" value="olives" />

<label for="olives">olives</label><br />

<input type="checkbox" name="extras[]"id="tomato" value="tomato" />

<label for="tomato">tomato </label><br />

<input type="checkbox" name="extras[]"id="beef" value="beef" />

<label for="beef"> beef</label><br />

<input type="checkbox" name="extras[]" id="pineapple" value="pineapple" />

<label for="pineapple">pineapple</label><br />

<input type="checkbox" name="extras[]" id="ham" value="ham" />

<label for="ham">ham</label>

<br />

<input type="checkbox" name="extras[]" id="capsicum" value="capsicum" />

<label for="capsicum">capsicum</label></p>

 

<p><input type="submit" name="Submit" value="Submit" />

<input type="reset" name="Reset" value="Reset" /></p>

 

</form>

</body>

</html>

Link to comment
https://forums.phpfreaks.com/topic/96002-help-new-at-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.