-11 Junior Poster in Training

Notice: Undefined index: username in C:\Users\User\l\htdocs\register.php on line 12

Notice: Undefined index: password in C:\Users\User\l\htdocs\register.php on line 13


$db_selected = mysql_select_db("users", $connect); 


$username = $_POST['username'];
$password = $_POST['password'];

    if(!$username || !$password){
    echo "One of the fields are empty";
    $find_multiple=" SELECT username FROM resgistration WHERE Username='$username' ";
    $run_multiple = mysql_query($find_multiple) or die (mysql_error());
    $num_multiple= mysql_num_rows($run_multiple);

    if($num_multiple < 1){
    $password= md5($password);

    mysql_query( "INSERT INTO `resgistration` (`username`, `password`) VALUES ('".$username."', '".$password."')" ) or die(mysql_error());
    echo "You have succesfully registered!";

        echo "That username has already beed used" ;

     } # endelse: empty password or username
} # endif: registered
<form action='' method='post'>
Username: <input type='text' name='username'/></br>
password: <input type='password' name='password'/></br>
<input type='submit' value='Register'name='register'/>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.