Unusual error in $_POST [HELP]

Discussion in 'PHP' started by minhazikram, Jan 22, 2012.

  1. #1
    $general = $_POST['general'];
    $body = mysql_prep($_POST['body']);
    $dsply = mysql_prep($_POST['dsplay']);
    $snd = mysql_prep($_POST['sound']);
    $mem = mysql_prep($_POST['mem']);
    $dt = mysql_prep($_POST['data']);
    $cmra = mysql_prep($_POST['camera']);
    $ftre = mysql_prep($_POST['features']);
    $btry = mysql_prep($_POST['battery']);
    //mysql query goes here

    $editQuery = "INSERT INTO modelname";
    $editQuery .=" VALUES( '";
    $editQuery .=" $brandposition','$setposition','$modelname','$picture','$general','{$body}','{$dsply}','{$snd}','{$mem}','{$dt}','{$cmra}','{$ftre}','{$btry}','{$price}')";


    these are the data taken from the form

    but still the error shows

    Notice: Undefined index: general in D:\xampp\htdocs\onairgsm\newgsm\insert_model.php on line 65

    Notice: Undefined index: body in D:\xampp\htdocs\onairgsm\newgsm\insert_model.php on line 66

    Notice: Undefined index: dsplay in D:\xampp\htdocs\onairgsm\newgsm\insert_model.php on line 67

    Notice: Undefined index: sound in D:\xampp\htdocs\onairgsm\newgsm\insert_model.php on line 68

    Notice: Undefined index: mem in D:\xampp\htdocs\onairgsm\newgsm\insert_model.php on line 69

    Notice: Undefined index: data in D:\xampp\htdocs\onairgsm\newgsm\insert_model.php on line 70

    Notice: Undefined index: camera in D:\xampp\htdocs\onairgsm\newgsm\insert_model.php on line 71

    Notice: Undefined index: features in D:\xampp\htdocs\onairgsm\newgsm\insert_model.php on line 72

    Notice: Undefined index: battery in D:\xampp\htdocs\onairgsm\newgsm\insert_model.php on line 73
     
    minhazikram, Jan 22, 2012 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    It tells you that the variables don't exists! so when you submit the form, these values are not posted!
     
    EricBruggema, Jan 22, 2012 IP