-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinsert.php
More file actions
27 lines (24 loc) · 1.09 KB
/
Copy pathinsert.php
File metadata and controls
27 lines (24 loc) · 1.09 KB
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
<?php
require('connect.php');
if(mysqli_connect_error()){
die('Connect Error('.mysqli_connect_errno().')'.mysqli_connect_error());
} else {
$name=mysqli_real_escape_string($con,$_POST['name']);
$email=mysqli_real_escape_string($con,$_POST['email']);
$password=mysqli_real_escape_string($con,$_POST['password']);
$age=mysqli_real_escape_string($con,$_POST['age']);
$building=mysqli_real_escape_string($con,$_POST['bldgname']);
$flatno=mysqli_real_escape_string($con,$_POST['flat']);
$phoneno=mysqli_real_escape_string($con,$_POST['phone']);
$sql = "INSERT INTO players (name,email,password,age,bldgname,flatno,phoneno)
VALUES('$name','$email','$password','$age','$building','$flatno','$phoneno')";
if(mysqli_query($con, $sql)){
echo "<script type=\"text/javascript\">
alert('Your issue has been posted!');
window.location='registrationpage.html';
</script>";
}else {
echo "Error".$sql."<br>".$con->error;
}
}
?>