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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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