Jump to content

form validation help


hoponhiggo

Recommended Posts

Hi

 

I am trying to expand on my current form validation code which is basic to say the least. the following code part of my registration form.

 

//form validation starts here
if(isset($_POST['username'])){
if($_POST['username'] == ""){
//username empty
die("You must enter a username");
}
} else {
//username not set
} 

if(isset($_POST['password'])){
if($_POST['password'] == ""){
//password empty
die("You must enter a password");
}
} else {
//password not set
} 

 

How can i expand on this to

 

a)echo the error messages on the same page?

b)ensure that passwords are a minimum amounts of characters?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/243365-form-validation-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.