-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinsertC.php
39 lines (34 loc) · 1.09 KB
/
insertC.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
38
39
<?php
include "config.php";
$stmt = $conn->prepare("SELECT * FROM customer WHERE CEmail = ?");
$stmt->bind_param("s", $email);
if (isset($_POST['Send'])) {
$email = $_POST['Email'];
};
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
echo "<div class='cancel'><h2>Email ID already registered</h2></div>";
} else {
$stmt = $conn->prepare("INSERT INTO Customer VALUES (?,?,?,?,?,?,?,?,?)");
$stmt->bind_param('ssissisis', $email,$name,$phno,$streetAddr,$area,$days,$sub,$aad,$pref);
if (isset($_POST['Send'])) {
$email = $_POST['Email'];
$name = $_POST['Name'];
$phno = $_POST['PhoneNo'];
$streetAddr = $_POST['Address'];
$area = $_POST['Area'];
$days = $_POST['Days'];
$sub = $_POST['Subscription'];
$aad = $_POST['Aadhar'];
$pref = $_POST['Preference'];
};
if ($stmt->execute()=== FALSE) {
echo "Error: " . $stmt . "<br>" . $conn->error;
} else {
header("Location: inserted.html");
}
}
$stmt->close();
$conn->close();
?>