-
Notifications
You must be signed in to change notification settings - Fork 0
/
request.php
38 lines (31 loc) · 1.14 KB
/
request.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
<?php
define("DB_SERVER", "localhost:3306");
define("DB_USER", "root");
define("DB_PASSWORD", "");
define("DB_DATABASE", "bdms");
$cnn = new mysqli(DB_SERVER , DB_USER, DB_PASSWORD, DB_DATABASE);
if (mysqli_connect_errno())
{
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$name = $_POST ['name'];
$phone = $_POST ['num'];
$email = $_POST ['mail'];
$birth = $_POST['dob'];
$bgroup = $_POST ['bgroup'];
$location = $_POST ['location'];
$address = $_POST ['addr'];
$sql = ("INSERT INTO request (pname,phone_no,email,dob,rblood_group,plocation,paddress) VALUES ('$name','$phone','$email','$birth','$bgroup','$location','$address')");
if ($cnn->query($sql) === TRUE)
{
echo "Request made successfully!!!";
echo " We will contact you soon regarding appointment:)";
//sleep(10);
header('Refresh: 10; URL=http://localhost/bdms/home.html');
//echo"<meta http-equiv="refresh" content="5;url=login.html">"
}
else {
echo "Error: " . "" . mysqli_error($cnn);
}
?>