Hello. Im trying to make a page wich takes user input
and echo the result back to the screen, but it only echo
one of the possible topping choices : cheese, ham, pinapple and
bacon. I wonder what Im doing wrong ?
Here is the script :
<?php
# Defines global variables
$ingrediens = $_POST['ingrediens'];
$ingrediens = array('Cheese','Ham','Pinapple','Bacon');
$part = $_POST['part'];
if (empty($_POST)) {
echo "What do you want on your pizza ?<br><br>";
echo "<form method='post' action='" . $_SERVER[PHP_SELF] . "'>";
foreach($ingrediens as $part) {
echo "<input type='checkbox' name='part' value='$part'>$part<br>";
}
echo "<br><input type='submit' name='add' value='Send_Order'>";
echo "</form>";
}
else {
echo "You have ordered pizza with :<br>";
echo "<font color=green>$part</font><br>";
echo "<a class='cd' href='" . $_SERVER[PHP_SELF] . "'>Order new pizza</a>";
}
?>