0

Please, i just started php programming and i have a project to build an E-commerce website, to post into my customer database i use the following codes

 <?php
    $connect = mysqli_connect("localhost","root","","shopping") or die
    ("Please,check the server connection.");
    $email_address= $_POST['email_address'];
    $password= $_POST['pass'];
    $repassword = $_POST['repassword'];
    $firstname= $_POST['first_name'];
    $lastname= $_POST['last_name'];
    $address1 = $_POST['address1'];
    $address2 = $_POST['address2'];
    $city = $_POST['city'];
    $state = $_POST['state'];
    $country = $_POST['country'];
    $school = $_POST['school'];
    $tel = $_POST['telno'];

     $sql = "INSERT INTO customer (email_address, pass, first_name,last_name,address1, address2,
city, state, school, country, telno)
     VALUES ('$email_address',(PASS('$password')), '$firstname', $lastname', '$address1',
'$address2', '$city', '$state', '$school', '$country', '$tel')";
      $result = mysqli_query($connect, $sql) or die(mysql_error());
      if ($result)
      {

    <p>
    Dear,  echo $firstname;  your account is successfully created

    }
    else
    {
    echo "Some error occurred. Please use different email address";
    }
    ?>

But it keeps telling me undefined index for each post variable, how do i go about this please?

Chris
  • 1
  • 1
  • 1

0 Answers0