-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinsert.php
37 lines (30 loc) · 917 Bytes
/
insert.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
include('db_connection.php');
if (isset($_POST['submit'])) {
// echo "button clicked";
$name = $_POST['name'];
$username = $_POST['username'];
$phone = $_POST['phone'];
$password = $_POST['password'];
//$Confirm_Password = $_POST['Confirm_Password'];
$gender = $_POST['gender'];
$query = "INSERT INTO customers(name, username, phone, password, gender ) VALUES ('$name', '$username', '$phone', '$password', '$gender' )";
// echo $query; exit;
if(mysqli_query($conn,$query))
{
$_SESSION['success']="Registered Successfully..!!";
header("Location: index.php");
exit;
}
else
{
$_SESSION['error']="User Not Registered Successfully..!!";
header("Location: index.php");
exit;
}
}
// else {
// echo "ALL FIELDS REQUIERD";
// }
// mysqli_query($conn,$query);
?>