-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew.php
More file actions
41 lines (41 loc) · 781 Bytes
/
Copy pathnew.php
File metadata and controls
41 lines (41 loc) · 781 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
30
31
32
33
34
35
36
37
38
39
40
41
<?php
$user=filter_input(INPUT_POST,'user');
$user1=filter_input(INPUT_POST,'user1');
$final=filter_input(INPUT_POST,'final');
if(!empty($user)){
if(!empty($user1)){
if(!empty($final)){
$host="localhost";
$dbusername="root";
$password="";
$dbname="mydatabase";
$conn= new mysqli($host,$dbusername,$password,$dbname);
if(mysqli_connect_error()){
die('connect error ( '.mysqli_connect_errno().')');
}
else{
$sql="INSERT INTO data (name,crush,result)
VALUES('$user','$user1','$final')";
if($conn->query($sql)){
echo "Thank You for Visiting Us";
}
else{
echo "error".$sql."<br>".$conn->error;
$conn->close();
}
}
}
else{
echo "result not be empty";
die();
}
}
else{
echo "your crush name cannot be empty";
die();
}
}
else{
echo "your name cannot be empty";
}
?>