guvna Posted March 22, 2018 Share Posted March 22, 2018 Need some directions with this question please: in login.php we have: // Assign $data to $errors for login_page.inc.php:$errors = $data; and in login_page.inc.php we have: // Print any error messages , if they exist: if (isset($errors) && !empty($errors)) { echo '<h1>Error!</h1> <p class="error">The following error(s) occurred:<br />'; foreach ($errors as $msg) { echo " - $msg<br />\n"; } // End of foreach. echo '<\p><p>Please try again.</p>'; // First closing <\p> tag displays in browser or error! } // End of errors IF. btw: I get '</p>' displayed on screen with this code along with errors (script 12#1). I need some direction on whether to change login.php to handle each error, to edit login_page_inc.php or both? I tried editing login_page_inc.php but the errors (if there are any) clear too quickly and the redirect script sends me to the home page. I will continue the book but would like to come back and address this. Link to comment Share on other sites More sharing options...
Larry Posted March 24, 2018 Share Posted March 24, 2018 Good question! You would change both files as login.php would need to be updated to create an array of errors and login_page.inc.php would need to be updated to handle an array. Link to comment Share on other sites More sharing options...
Recommended Posts