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

Registratio

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!