Jump to content

Register.php causing errors?


desjardins2010

Recommended Posts

The code below is working in relation to what I expect it to do however it is allow causing this error on top of the form everytime...

 

Notice: Undefined index: submit in C:\wamp\www\protek\register.php on line 130

Notice: Undefined index: fullname in C:\wamp\www\protek\register.php on line 133

Notice: Undefined index: email in C:\wamp\www\protek\register.php on line 134

Notice: Undefined index: username in C:\wamp\www\protek\register.php on line 135

Notice: Undefined index: password in C:\wamp\www\protek\register.php on line 137

Notice: Undefined index: password2 in C:\wamp\www\protek\register.php on line 138

The full code being used is >

 

<?php
//check for submit
$submit =$_POST['submit'];

//gather POST variable
$fullname =strip_tags($_POST['fullname']);
$email =strip_tags($_POST['email']);
$username =strip_tags($_POST['username']);

$password =strip_tags($_POST['password']);
$password2 =strip_tags($_POST['password2']);

if ($submit) 
{
//check that fields were filled in
if ($fullname&&$email&&$username&&$password&&$password2)
{
//now we can encrypt our password to md5
$password = md5($password);
$password2 = md5($password2);
//were done seeting md5
//check to see if our two password fields match	
if ($password==$password2)
{

//check to see if the password is greateer than 25 but less than 6
if (strlen($password)>25||strlen($password)<6)
{
//if it is then
echo "<font color='red'>Your password must be between 6-25 characters</font>";
}
//otherwise register the user
else 
{
echo "Success";

}
}
//otherwise if passwords don't match
else
echo "<font color='red'>The passwords you entered do not match</font>";
//end of checking password	

}
else
echo "<font color='red'>Please enter all fields!</font>";
}
//end check for submit 

?>

Link to comment
https://forums.phpfreaks.com/topic/221140-registerphp-causing-errors/
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.