Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by Aldayne_Henry

  1. sorry for the late reply @barand my internet is so shakey where i am at now. I want to ensure that the user enters the format for academic year example( 2020/21 ). But when i used the code below it allows for even letters into the mix as well and without brackets as well. How would i go about ensuring the user uses the format (2020/21) ... brackets included if(!empty($_POST ['ay'])) { if(!preg_match(" ([0-9/])",$_POST['ay'])) { $formerrors [] = ' " Incorrect format for academic year " '; } }
  2. i have another issue.. @Barand i want to retain the post form data in the form fields so when there is an error it still keeps the data the user entered in the field.. is there anyway you can assist with that?
  3. <?php session_start(); if($_SERVER['REQUEST_METHOD'] == 'POST') { $post2= array_map('trim', $_POST); $verrors = []; if($post2['address'] == '') { $verrors= ' " Please enter a street address" '; } if($post2['district'] == '') { $verrors= ' "Please enter a district" '; } if($post2['parish'] == '') { $verrors= ' "Please enter a city or parish" '; } if($post2['country'] == '') { $verrors= ' "Please enter a country" '; } if($post2['email'] == '') { $verrors= ' "Please enter an email" '; } if($post2['tele'] == '') { $verrors= ' "Please enter a tele
  4. yes cause on my validation page i did $post['errors']= $errors and then on my form page i did if(isset($_GET['errors']) && !empty($_GET['errors'])) so i dont know why it is not working for this page because it worked for the other
  5. <?php session_start(); ?> <!DOCTYPE html> <html> <head> <title> Medical Login Page </title> <link rel="stylesheet" type="text/css" href="Registrationcss2.css"> </head> <body background="testtube.jpg"> <?php if (isset($_GET['errors']) && !empty($_GET['errors']) ) { echo "<div style='padding:16px; background-color: red; color: white'>".join('<br>', $_GET['errors'])."</div>"; } ?> <div id="login.wrapper"> <div class="container"> </div> <form action
  6. @Barand sorry for being so bothersome.. i just need help with displaying the data from the seperate pages on one page.. is that possible? if so how do i go about it
  7. i have one more issue @Barand, how would i then output the data from the first page and the second page? i would want them to be displayed together on another page. is that possible?
  8. <?php session_start(); if($_SERVER['REQUEST_METHOD'] == 'POST') { $post= array_map('trim', $_POST); $errors = []; if ($post['firstname']== '') { $errors[] = "<p>Please enter the patient first name</p>" ; } if($post['lastname'] == '') { $errors[]= "<p>Please enter a last name</p>" ; } if($post['dateofbirth'] == '') { $errors[]= "<p>Please select a date of birth</p>" ; } if($post['trn'] == '') { $errors[] = "<p>Please Enter a trn</p>" ; } if($errors) { $post['errors']= $errors; $qstr
  9. This is the form code <?php session_start(); $firstn=""; $lastn=""; $dateofbirth= ""; $title=""; $TRN= ""; $firstnameerror=""; $lastnameerror=""; $trnerror=null; $doberror=""; $titleerror=""; ?> <!DOCTYPE html> <html> <head> <title> Medical Login Page </title> <link rel="stylesheet" type="text/css" href="Registrationcss.css"> </head> <body background="testtube.jpg"> <div id="login.wrapper"> <div class="container"> </div> <form action="validateregistrationpage.php" method="POST" id="lo
  10. 1. What do you mean i should check the post method request? 2. trim the post array? 3. kill the script after header redirect? //This is the php code <?php session_start(); if(isset($_POST['next'])) { $firstn=$_POST['firstname']; $lastn=$_POST['lastname']; $dateofbirth= $_POST['dateofbirth']; $title=$_POST['title']; $TRN= $_POST['trn']; $firstnameerror=""; $lastnameerror=""; $trnerror=null; $doberror=""; $titleerror=""; $_SESSION['errorflag'] = 0; if(empty($_POST['firstname'])) { $first
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.