i am trying to build a simple login system with php , but it dosent send the the user data to the data base i an using XAMPP as a server, plz check my code...
here is my dbh.inc.php - the file that connect to the server.
<?php
$dbservername="localhost";
$dbusername="root";
$dbpassword="";
$dbname="loginsystem";
$conn= mysqli_connect($dbservername,$dbusername,$dbpassword,$dbname);
and here is my php script signup.inc.php that handle that send the data to the data base and tell it to put it in the pre table that i have set from the beginning
<?php
if (isset($_POST['submit'])) {
include_once 'dbh.inc.php';
$first = mysqli_real_escape_string($conn, $_POST['first']);
$last = mysqli_real_escape_string($conn, $_POST['last']);
$email = mysqli_real_escape_string($conn, $_POST['email']);
$uid = mysqli_real_escape_string($conn, $_POST['uid']);
$pwd = mysqli_real_escape_string($conn, $_POST['pwd']);
// inset the form data to the data base .
$sql= "INSERT_INTO users (user_first, user_last, user_email, user_uid, user_pwd) VALUES ('$first', '$last' , '$email', '$uid' , '$pwd');";
mysqli_query($conn, $sql);
exit();
// error handlers
// check for empty fields.
}
else {
header("Location: ../signup.php");
exit();
}