-
Notifications
You must be signed in to change notification settings - Fork 2
/
send.php
65 lines (57 loc) · 1.61 KB
/
send.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
$success='
<html>
<head>
<title>Welcome | Registeration</title>
</head>
<body>
<form action="?" method="post">
<fieldset>
<legend>Account created SuccessFully</legend>
<p><a href="access.php">Login Page</a></p>
</fieldset>
</form>
</body>
</html>
';
if(isset($_POST['submit']))
{
$type=$_GET['type'];
$name=$_POST['fname'] . ' ' . $_POST['mname']. ' ' . $_POST['lname'];
$dob=$_POST['dob'];
$gender=$_POST['gender'];
$dor='1995-10-15';
$email=$_POST['email'];
$add=$_POST['add'];
$username=$_POST['uname'];
$password=$_POST['password'];
if($type=='free')
{
$query="INSERT INTO free(name,DoB,DoR,gender,email,address) values ('" . $name . "','" .$dob. "','" .$dor. "','" .$gender. "','" . $email . "','" . $add . "')";
}
else if($type=='premium')
{
$query="INSERT INTO premium(name,DoB,DoR,gender,email,address) values ('" . $name ."','" . $dob . "','" . $dor . "','" . $gender . "','" . $email . "','" . $add . "')";
}
else
{
//echo 'Some error occured\nPlease fill again you are redirected to registration page within 5 sec...';
header("Location:register.php?try=false");
exit();
}
require './module/class/Database.php';
$db = new Database();
if($db->connect()){
$db->sql($query);
$res = $db->getResult();
print_r($res);
$query_2="INSERT INTO login(username,password) VALUES('" .$username. "','" . $password . "')";
$db->sql($query_2);
$res = $db->getResult();
print_r($res);
$db->disconnect();
}else{
echo 'Database connection error';
}
}
?>