-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.php
46 lines (42 loc) · 1.29 KB
/
action.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
36
37
38
39
40
41
42
43
44
45
46
<?php
include 'server.php';
if ( isset( $_POST['submit'] ) )
{
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "empowher";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// sample
$name = $_POST['name'];
$emailid = $_POST['emailid'];
$contactno = $_POST['contactno'];
$dob = $_POST['dob'];
$pwd = $_POST['pwd'];
$gender = $_POST['gender'];
$sql_stmt = "INSERT INTO register (Name, E_mailId, ContactNumber , DateofBirth, Password, Gender)
VALUES ('$name','$emailid','$contactno','$dob','$pwd','$gender')";
//echo 'Query ==> '.$sql_stmt;
if ($conn->query($sql_stmt) == TRUE)
{
echo '<script language="javascript">';
echo 'alert("Thanks for registering with Empowher");';
echo 'window.location.href="index.php";';
echo '</script>';
}
else
{
echo '<script language="javascript">';
$err = "Error: " . $sql_stmt . "<br>" . $conn->error;
echo 'alert('.$err.')';
echo '</script>';
//echo "";
}
$conn->close();
}
?>