-
Notifications
You must be signed in to change notification settings - Fork 2
/
newdata.php
35 lines (29 loc) · 910 Bytes
/
newdata.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
<?php
header('Access-Control-Allow-Origin: *');
// error_reporting(0);
$servername = "localhost";
<<<<<<< HEAD:newdata.php
$username = "******";
$password = "**********";
$dbname = "**********";
=======
$username = "";
$password = "";
$dbname = "";
>>>>>>> b960d1c531901f9f1bc6d062e2fc7705a121b0a0:server/newdata.php
// Create connection
$new = new mysqli($servername, $username, $password,$dbname);
// Check connection
if ($new->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$name = $_POST['name'];
$dept = $_POST['dept'];
$place = $_POST['place'];
$hosp = $_POST['hosp'];
$phone = $_POST['phone'];
$query = "INSERT INTO input(name,department,hospital,place,phone) values('".$name."','".$dept."','".$hosp."','".$place."','".$phone."')";
if($new->query($query)) {
echo "Data Uploaded Successfully!";
}
?>