Form data entered by client

You didn't enter a value for first name." . "
" . "Please go back and re-enter a value for first name." . "

"; exit; } echo "

Order processed
"; echo "The current time and date is " . date("H:i, jS F"); echo "
"; /* Show the entered form information back to the browser window. If the form has differently named form elements, you will have to change them in this PHP file. */ echo "First name is " . $firstname . "
"; if ( $lastname) echo "Last name is " . $lastname . "
"; if ( $phone ) echo "phone is " . $phone . "
"; if ( $credit ) echo "Credit card is " . $credit . "
"; if ( $expiry ) echo "Expiry is " . $expiry . "
"; if ( $pizza ) echo "Pizza type is " . $pizza . "
"; if ( $size ) echo "Pizza size is " . $size . "
"; if ( count( $topping) > 0 ) { echo "Selected toppings is/are "; foreach($topping as $key => $value) { echo $value . " "; } echo "
"; } echo "Quantity is " . $quantity . "
"; echo "Order is " . $order . "
"; /* Write the information to the file myOrders.txt, which should have write permission to "others". First check if the orders file can be opened with append. */ @ $fp = fopen("./myOrders.txt", "a"); if (!$fp) { echo "

Your order cannot be processed at this time. " . "Please try again later.
" . "Return to the form" . "

"; exit; } /* $outputString is assigned the information you entered on the form separated by tabs (the \t means tab) */ /* For any form information not entered, the associated PHP variable will contain nothing (blank). */ /* The pizzaTop[0] contains the first checkbox form element value or blank if it wasn't checked. */ /* The \n is necessary at the very end of the string so that each record starts on a new line. */ $outputString = $date . "\t" . $firstname . "\t" . $lastname . "\t" . $credit . "\t" ; if ( count( $topping) > 0 ) { foreach($topping as $key => $value) { $outputString .= $value . "\t"; } } $outputString .= $pizza . "\n"; /* Write out the form information through the file pointer to the file myOrders.txt. */ fwrite($fp, $outputString); /* Close the file pointer now that we are finished working with the file. */ fclose($fp); /* PHP can include an e-mail function so that you may optionally email the form information. */ // imap_mail("zz@shaw.ca", "Test Message", $outputString, "From:Ghostly"); ?>

Return to the form