-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.php
More file actions
42 lines (35 loc) · 1.09 KB
/
Copy pathinsert.php
File metadata and controls
42 lines (35 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
//error_reporting(0);
$con = mysqli_connect('localhost','id11590341_rajat','Rajat@123','id11590341_mydb');
if($conn)
{
echo "Connection succesfull";
}
else
{
echo "error";
}
$connect = mysqli_connect('localhost', 'root', '', 'testing');
$name = $_POST["name"];
$email = $_POST["email"];
$password = $_POST["password"];
$confirmPassword = $_POST["confirmPassword"];
$phone = $_POST["phone"];
$city = $_POST["city"];
$collegeName = $_POST["collegeName"];
$qy = "INSERT INTO tbl_employee(name, email, password, confirmPassword, phone, city, collegeName) VALUES ('$name', '$email', '$password', '$confirmPassword','$phone','$city','$collegeName')";
$data = mysqli_query($conn, $qy) or die(mysqli_error($conn));
if($data)
{
echo '<script language="javascript">';
echo 'alert("Data is successfully sent")';
echo '</script>';
}
else
{
echo '<script language="javascript">';
echo 'alert("All fields are required.")';
echo '</script>';
}
?>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL= http://localhost/My/index.php">