The document includes a series of PHP and HTML files created by Aditya Bansal for an assignment, featuring a widget order form, a conditional processing script, a registration form, and a reply page. The widget order form allows users to specify a quantity of widgets, calculates total cost with tax and potential discounts, and provides payment options. The registration form collects user information and displays a confirmation message upon submission.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
3 views4 pages
Assignment 3 PHP
The document includes a series of PHP and HTML files created by Aditya Bansal for an assignment, featuring a widget order form, a conditional processing script, a registration form, and a reply page. The widget order form allows users to specify a quantity of widgets, calculates total cost with tax and potential discounts, and provides payment options. The registration form collects user information and displays a confirmation message upon submission.
echo ("<h2>The payment calculation program</h2>"); echo ("<h2>programmed by {Aditya Bansal}</h2>"); echo ("You requested to purchase $quantity widget(s) at \$$cost each.<br />"); echo ("The total with tax, minus any discount, comes to $"); echo ($totalcost); echo (".<br />You may purchase the widget(s) in 12 monthly installments of $"); echo ($payments); echo (" each.<br />"); } else { // Display error message if quantity is empty echo ("Please make sure that you have entered a quantity and then resubmit."); } ?> </body> </html> {registerForm.php}
<!DOCTYPE html> <html> <head><title>Register Form</title></head> <body> <h2>Welcome to the ABC Web Site</h2> <h3> - programmed by Aditya Bansal - </h3> <form action="reply.php" method="post"> <p> Enter your name: <input type="text" name="username"><br /> You live in: <input type="text" name="region"><br /><br /> <input type="submit" name="SUBMIT" value="Submit"> <input type="reset" name="RESET" value="Clear"></p> </form> <p><br /><em> <?php echo "Date: " . date('F dS, Y'); ?> </em></p> </body> </html>
{reply.php}
<!-- Student Name: Aditya Bansal Student Id: 0825487 Class: MIT439_004 Assignment: 3 Date: 31 January 2024 URL: https://w24aer.scweb.ca/MIT439/week3/reply.php --> <!DOCTYPE html> <html><head><title>Process Registration Form</title></head> <body><h2>ABC Web Site Registration Reply Page</h2> <?php $username = $_POST['username']; $region = $_POST['region']; if (empty($username)) { echo "You did not enter a username.<br />"; echo "Please return to the form and re-enter your information"; } else { echo "<h3>Your information has been processed.</h3>"; echo "Thank you $username<br />"; echo "From the lovely region of : $region";} ?> </body> </html>