Question: Why wont my php file show what the user entered for information such as his username and password? Here is my code test1.php require_once(Template.php); $page

Why wont my php file show what the user entered for information such as his username and password? Here is my code

test1.php

require_once("Template.php");

$page = new Template("My Page"); $page->finalizeTopSection(); $page->finalizeBottomSection();

print $page->getTopSection(); print "

Registration Form

"; print "

"; print "Username: "; print "Email Address: "; print "Password: "; print "Confirm Password: "; print " "; print "

"; print $page->getBottomSection();

test2.php

require_once("Template.php");

$page = new Template("My Page"); $page->finalizeTopSection(); $page->finalizeBottomSection();

print $page->getTopSection();

if ($_SERVER['REQUEST_METHOD'] === 'POST') { print "Thank you for registering"; } else { print "Please fill in the form"; }

$expectedFields = array("username", "pass1", "pass2", "email", );

foreach ($expectedFields as $field) { if (!isset($_POST[$field]) || empty($_POST[$field])) { print "Please fill the form in. "; print $page->getBottomSection(); exit; } }

print "You have been registered with the username" print "and the password"

print $page->getBottomSection();

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!