-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnewdata.php
More file actions
29 lines (23 loc) · 777 Bytes
/
newdata.php
File metadata and controls
29 lines (23 loc) · 777 Bytes
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
<?php
header('Access-Control-Allow-Origin: *');
// error_reporting(0);
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "cybella";
// 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'];
$year = $_POST['year'];
$prog = $_POST['prog'];
$phone = $_POST['phone'];
$query = "INSERT INTO register(name,department,year,programme,phone) values('".$name."','".$dept."','".$year."','".$prog."','".$phone."')";
if($new->query($query)) {
echo "Data Uploaded Successfully!";
}
?>