I am trying to insert data on my database, but when i do, it says UNDEFINED INDEX

HTML code here

<form  action="insert.php" autocomplete="on"> 
        <h1> Sign up </h1> 
                                    <label for="username">Your username</label>
                                    <input id="username" name="username" type="text" />
                                    <label for="emails"  > Your email</label>
                                    <input id="emails" name="emails" type="email" /> 
                                    <label for="password" >Your password </label>
                                    <input id="password" name="password"  type="password" />
                                    <label for="passwordcon" >Please confirm your password </label>
                                    <input id="passwordcon" name="passwordcon"  type="password" />
                                <p class="signin button"> 
                                    <input type="submit" value="Sign up"/> 


PHP Code Here


if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();

$username = mysqli_real_escape_string($con, $_POST['username']);
$emails = mysqli_real_escape_string($con, $_POST['emails']);
$password = mysqli_real_escape_string($con, $_POST['password']);
$passwordcon = mysqli_real_escape_string($con, $_POST['passwordcon']);
$sql="INSERT INTO users (usernamesignup, emailsignup, passwordsignup, passwordsignup_confirm)
VALUES ('$username', '$emails', '$password', '$passwordcon')";

if (!mysqli_query($con,$sql)) {
  die('Error: ' . mysqli_error($con));
echo "1 record added";


thank you in advance..

i managed to fixed it. lol

well, I'm late ... it should be:

<form action="insert.php" method="post" autocomplete="on"> 
Be a part of the DaniWeb community

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