drfls28608 2016-05-23 19:52
浏览 15

PHP表单未插入

i have a php form which should insert data into my database when a button is press. but its doing nothing, no errors and i dont know why. please help i have gone through my Code several times but i cant see a problem

 if(isset($_POST['button1'])){
    //geting text data from the feilds
    $applicatioID = $_POST['applicaionid'];
    $postionaplied = $_POST['postionaplied'];
    $weight = $_POST['weight'];
    $fullname = $_POST['fullname'];
    $persontel = $_POST['persontel'];
    $height = $_POST['height'];
    $age = $_POST['age'];
    $brithdate = date("Y-m-d", strtotime($_POST['brithdate']));
    $placeofbirth = $_POST['placeofbirth'];
    $fathernamee = $_POST['fathernamee'];
    $mothername = $_POST['mothername'];
    $nationality = $_POST['nationality'];
    $passportnumber = $_POST['passportnumber'];
    $placeofisue = $_POST['placeofisue'];
    $issudate = date("Y-m-d", strtotime($_POST['issudate']));
    $expirydate = date("Y-m-d", strtotime($_POST['expirydate']));
    $passportcopy = $_FILES['passportcopy']['name'];
    $applcaphoto = $_FILES['applcaphoto']['name'];
    $institue1 = $_POST['institue1'];
    $course1 = $_POST['course1'];
    $year1 = date("Y-m-d", strtotime($_POST['year1']));
    $institue2 = $_POST['institue2'];
    $corse2 = $_POST['corse2'];
    $year2 = date("Y-m-d", strtotime($_POST['year2']));
    $institue3 = $_POST['institue3'];
    $corse3 = $_POST['course3'];
    $year3 = date("Y-m-d", strtotime($_POST['year3']));
    $company1 = $_POST['company1'];
    $emppostion1 = $_POST['emppostion1'];
    $empyear1 = date("Y-m-d", strtotime($_POST['empyear1']));
    $company2 = $_POST['company2'];
    $emppostion2 = $_POST['empposion2'];
    $empyear2 = date("Y-m-d", strtotime($_POST['empyear2']));
    $company3 = $_POST['company3'];
    $emppostion3 = $_POST['emppostion3'];
    $empyear3 = date("Y-m-d", strtotime($_POST['empyear3']));
    $homelicense = $_POST['homelicense'];
    $gcclicesnse = $_POST['gcclicesnse'];
    $gcccountry = $_POST['gcccountry'];


    $insert_product= insert into applacions
 app_id,fullname,positionaplied,age,personaltel,dateofbirth,weightt,height,place,nationality,fathername,mothername,passportname,issueplace,issudate,expirdate,pas   sportcopy,aplicantphoto,institution1,course,complitionyear,institution2,course2,complitionyear2,
              institution3,course3,complitionyear3,company,postion,endyear,company2,postion2,e                 ndyear2,homelicense,gcclicense,gcccountry,interviewcomt,applicaiondate

  )VALUES('$applicatioID','$fullname','$postionaplied','$age','$persontel','$brith            date','$weight','$height','$placeofbirth','$nationality','$fathernamee','$mother       name','$passportnumber','$placeofisue','$issudate','$expirydate','$passportcopy','$applcaphoto','$institue1','$course1','$year1','$institue2','$corse2','$year2','$institue3','$corse3','$year3','$company1','$emppostion1','$empyear1','$company2','$emppostion2','$empyear2','$company3','$emppostion3','$empyear3','$homelicense','$gcclicesnse','$gcccountry',NOW());

 if($run_query = mysqli_query($conn,$insert_product)){
        echo"<script>alert('product Has been Inserted')</script>";
        echo"<script>window.open('application.php','_self')</script>";
    }



}
  • 写回答

1条回答 默认 最新

  • drt5813 2016-05-23 20:31
    关注

    You are not send button to the server. Only data fields

    for example:

    HTML

    <form>
      <input type="text" name="sendData[fieldname]">
      <input type="submit">
    </form>
    

    PHP

    if(isset($_POST['sendData'])) {
        $fieldname = $_POST['sendData']['fieldname'];
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类