So, I have been working on a login page, and it has been working beautifully so far. However, I cannot style where the error message appears. Here is the code: — The login.php file — <?php include_once ‘../resources/session.php’; include_once ‘../resources/database.php’; include_once ‘../resources/utilities.php’; if(isset($_POST[‘loginBtn’])){ // array to hold errors $form_errors = array(); // validate $required_fields = […]
- Tags 'email' => 12) * @return array, 'password'); $form_errors = array_merge($form_errors, "Value"), #00ced1) center bottom 5px /calc(100% - 10px)2px no-repeat; } .loginBtn{ border: none; text-decoration: none; padding-left: 10%;, #00ced1) center bottom 5px /calc(100% - 10px)2px no-repeat; } .passwordinput:focus{ outline: none; background: linear-gradient, #c0c0c0) center bottom 5px /calc(100% - 10px)2px no-repeat; font-size: 18px; } .formtitle{ font-size: 30px; margin-left: 73%;, #c0c0c0) center bottom 5px /calc(100% - 10px)2px no-repeat; font-size: 18px; } .passwordinput{ background: linear-gradient(#c0, $data)){ // check if the email field has a value if($_POST[$key] != null){ // remove all illegal characters fro, $db){ try{ $sqlQuery = "SELECT * FROM " .$table. " WHERE " .$column_name. "=:$column_name"; $statement = $db->prepare($sqlQuery);, $hashedpassword)){ $_SESSION['id'] = $id; $_SESSION['username'] = $username; redirectTo('dash, $passOrFail = "Fail"){ if($passOrFail === "Pass"){ $data = "{$message}";, an array containing the name of fields * for which we wnt th check min required length e.g. array('username' => 4, and it has been working beautifully so far. However, check_empty_fields($required_fields)); if(empty($form_errors)){ // collect form data $user = $_POST['username'];, COLUMN_NAME, containing all errors */ // start function check_empty_fields($required_fields_array){ // initialize an array to store error messag, containing all errors */ function check_min_length($fields_to_check_length){ //initialize an array to store error messages $form_err, containing email error */ function check_email($data){ //initialize an array to store error messages $form_errors = array(); $ke, FILTER_SANITIZE_EMAIL); // check if input is a valid email addresss if(filter_var($_POST[$key], FILTER_VALIDATE_EMAIL) === false){ $form_errors[] = $key . " is not a valid email address"; } } }, I cannot style where the error message appears. Here is the code: -- The login.php file -- <?php include_once '../resources/session.php'; i, I have been working on a login page, list containing all error messages */ function show_errors($form_errors_array){ $errors = ""; // loop t, must be {$minimum_length_required} characters long"; } } return $form_errors; } /** * @param $data, n array containing the list of all required fields * @return array, serif; } .links{ text-decoration: none; color: black; font-size: 70%;, So, so it looks like this: Any help is greatly appreciated! Thanks in advance!, store a key/value pair array where key is the name of the form control * in this case 'email' and value is the input entered by the user, the array holding all * errors which we want to loop through * @return string, the error message appears at the bottom of the screen instead of under Login Form. And also, the form title gets dragged down too