Question
I need help with a three step homework: Lets practice working with control structures by modifying a PHP script. In Chapter 6 of our textbook
I need help with a three step homework: Lets practice working with control structures by modifying a PHP script. In Chapter 6 of our textbook we use the handle_reg.php file to demonstrate the use of if, switch, and loop statements. After working with the examples in the chapter, modify the handle_reg.php to do the following: Rewrite handle_reg.php so that it uses a variable for the current year, instead of hard-coding that value. Name your file handle_reg_1.php For debugging purposes, add code to the beginning of the handle_reg.php script that prints out the values of the received variables. Hint: Theres a short and a long way to do this. Name your file handle_reg_2.php Update handle_reg.php so that it validates the users birthday by looking at the three individual form elements: month, day, and year. Create a variable that represents the users birthday in the format XX/DD/YYYY. Hint: Youll have to use concatenation. Name your file handle_reg_3.php I need to submit the three modified PHP script files.
Here is the example from the text book:
1 2 3 4 5Registration 6 9 10 11Registration Results
12 if (empty($_POST['email'])) { 23 print 'Please
enter your email address.'; 24 $okay = false; 25 } 26 27 // Validate the password: 28 if (empty($_POST['password'])) { 29 print 'Please
enter your password.'; 30 $okay = false; 31 } 32 33 // If there were no errors, print a success message: 34 if ($okay) { 35 print 'You have been successfully registered (but not really).
'; 36 } 37 ?> 38 39
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started