-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathallfunction2.php
More file actions
69 lines (48 loc) · 1.53 KB
/
allfunction2.php
File metadata and controls
69 lines (48 loc) · 1.53 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
include_once('connection.php');
// echo "<pre>";
// print_r($_GET);
// print_r($_POST);
// print_r($_REQUEST);
if(isset($_POST['registrationbn'])){
$username = $_POST['u_name'];
$password = $_POST['password'];
$name = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$sql = "INSERT INTO user (`u_name`,`password`,`name`,`phone`,`email`) VALUES ('".$username."','".$password."','".$name."','".$phone."','".$email."')";
if($conn->query($sql)){
header('Location:register.php');
exit();
}else{
header('Location:register.php');
exit();
}
}
if(isset($_POST['updatebn'])){
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$r_type = $_POST['r_type'];
$event = $_POST['event'];
$ticket = $_POST['ticket'];
$unique_id = $_POST['unique_id'];
$seat = $_POST['seat'];
$sql = "UPDATE event_table SET name='".$name."', email='".$email."', phone='".$phone."',r_type='".$r_type."',event='".$event."',ticket='".$ticket."',unique_id='".$unique_id."',seat='".$seat."' WHERE user_id='".$user_id."'";
if($conn->query($sql)){
header('Location:event_details.php');
exit();
}else{
header('Location:event_details.php');
exit();
}
}
if(isset($_GET['mode']) && $_GET['mode']=="delete"){
$user_id = $_GET['user_id'];
$sql = "DELETE FROM event_table WHERE user_id='".$user_id."'";
if($conn->query($sql)){
header('Location:event_details.php');
exit();
}
}
?>