Catch an Error on html with php -


currently i'm developing website in class in university. i'm using php , mysql.

i have signup page when submitted goes auxiliary php page goes through number of conditions , i'f form failed in 1 of conditions wanted return signup page appeared line detailing error.

i wanted know if need use php or php+javascript.

thanks in advance.

to points use both!

add jquery validate plugin form. display real time errors user. can't totally rely on method though because if user switches off js validation wornt work ;)

in php run through validation checks , if 1 fails use header (as phpnutt mention above) wouldn't recommend passing error message in url can unprofessional. instead number, check number on signup page. if it's there then display error.

// auxiliary php page   if (conditon met) {   } else {     header("location: /signup_page.php?error=1");     exit;  }   // signup page  if(isset($_get['error']) && $_get['error']==1) {  echo "<h3>form failed, please try again</h3>";  } 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -