我的PHP SQL插件刚刚停止工作

时间:2018-01-28 22:47:04

标签: php html mysql html5 mysqli

大家好,我的网络应用程序在30分钟前工作得很好,现在sql不再在数据库中插入用户输入。我正在使用php和mysql并且没有错误....当我直接在phpmyadmin中的表中插入它工作正常。我正在使用LAMP,UBUNTU 16.04代码在下面..

...表格

<form class="application" action="includes/application.inc.php" method="POST">
    <input type="text" name="firstname" placeholder="Firstname" required ><br>
    <input type="text" name="lastname" placeholder="Lastname" required ><br>
    <input type="text" name="age" placeholder="Age" required ><br>
    <input type="email" name="email" placeholder="Email" required><br>
    <input type="text" name="cell" placeholder="Cell" required><br>
    <input type="text" name="city" placeholder="City" required><br>
    <input type="text" name="qualification" placeholder="Highest Qualification" required><br>
    <input type="text" name="employment" placeholder="Employment Status" required><br>
    <input type="text" name="facebook" placeholder="Faceboook Profile Link" ><br>
    <input type="text" name="linkedin" placeholder="LinkedIn Profile Link" ><br>
    <button type="submit" name="submit">Apply</button>
  </form>

application.inc.php ........

if (isset($_POST['submit'])) {

include 'db.inc.php';

//escape variables for security....
$firstname = mysqli_real_escape_string($conn,$_POST['firstname']);
$lastname = mysqli_real_escape_string($conn,$_POST['lastname']);
$age = mysqli_real_escape_string($conn,$_POST['age']);
$email = mysqli_real_escape_string($conn,$_POST['email']);
$cell = mysqli_real_escape_string($conn,$_POST['cell']);
$city = mysqli_real_escape_string($conn,$_POST['city']);
$qualification = mysqli_real_escape_string($conn,$_POST['qualification']);
$employment = mysqli_real_escape_string($conn,$_POST['employment'] );
$facebook = mysqli_real_escape_string($conn,$_POST['facebook']);
$linkedin = mysqli_real_escape_string($conn,$_POST['linkedin']);

//insert user data into the database...
$insert = "INSERT INTO users (name, surname, user_age, user_email, user_cell, user_city, user_qualification, employment_status, facebook_profile, linkedin_profile ) VALUES ('$firstname', '$lastname', '$age', '$email', '$city', '$cell', '$qualification', '$employment', '$facebook', '$linkedin')";

mysqli_query($conn, $insert);

header('Location: ../thankYou.php');
exit();

} else {
  header('Location: ../apply.php');

}

0 个答案:

没有答案