Question
I really need help with this assignment. The assignment is in PHP code 1 Rewrite handle_reg.php so that it uses a variable for the current
I really need help with this assignment. The assignment is in PHP code
1 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
2 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
3 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
Submit the three modified PHP script files.
The code that i have is
.error { color: red; }
Registration Results
$okay = true;
if (empty($_POST['email'])) {
print '
Please enter your email address.
';$okay = false;
}
if (empty($_POST['password'])) {
print '
Please enter your password.
';$okay = false;
}
if (is_numeric($_POST['year'])) {
$age = 2017 - $_POST['year'];
} else {
print '
Please enter the year you were born as four digits.
';$okay = false;
}
if ($okay) {
print '
You have been successfully registered(but not really).
';print "
You will turn $age this year.
";}
?>
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