Skip to content

Instantly share code, notes, and snippets.

@caseysoftware
Created September 10, 2012 14:00
Show Gist options
  • Select an option

  • Save caseysoftware/3691102 to your computer and use it in GitHub Desktop.

Select an option

Save caseysoftware/3691102 to your computer and use it in GitHub Desktop.
<?php
if($_POST['submitButton']=="Submit Order"){
echo "<h1>Order Confirmation Page!</h1><br />";
echo "Name: {$_POST['Name']}<br />";
echo "Address: {$_POST['Address']}<br />";
echo "Cheese Choices: ";
foreach($_POST['cheese'] as $value){
echo "$value ";
}
echo "<br />";
echo "Meat Choices: ";
foreach($_POST['meat'] as $value){
echo "$value ";
}
echo "<br />";
echo "Topping Choices: ";
foreach($_POST['topping'] as $value){
echo "$value ";
}
echo "<br />";
echo "Drink Choice: {$_POST['drink']}<br />";
echo "Special Instructions: {$_POST['text']}<br />";
echo '<a href="d3x3.php">Return to Form</a>';
}
else{ ?>
<form action="d3x3.php" method="post" target="_blank">
<h1>Welcome to the Sandwhich Ordering System!</h1>
<b>Name:</b> <input type="text" name="Name"><br />
<b>Address:</b> <input type="text" name="Address"><br />
<b>Cheese Choices:</b> American:<input type="checkbox" value="American" name="cheese[]"> Swiss:<input type="checkbox" value="Swiss" name="cheese[]"> Parm:<input type="checkbox" value="Parm" name="cheese[]"><br />
<b>Meat Choices:</b> Turkey:<input type="checkbox" value="Turkey" name="meat[]"> Ham:<input type="checkbox" value="Ham" name="meat[]"><br />
<b>Topping Choices:</b> Tomatoe:<input type="checkbox" value="Tomatoe" name="topping[]"> Mayo:<input type="checkbox" value="Mayo" name="topping[]"> Lettuce:<input type="checkbox" value="Lettuce" name="topping[]"><br />
<b>Drink Choice:</b> Coke:<input type="radio" value="Coke" name="drink"> Sprite:<input type="radio" value="Sprite" name="drink"><br />
<textarea rows="5" cols="20" name="text" wrap="physical">Enter additional instructions!</textarea>:<br />
<input type="submit" name="submitButton" value="Submit Order" />
</form>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment