-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path18.write_query.php
32 lines (24 loc) · 904 Bytes
/
18.write_query.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
<?php
if (strpos(basename($_SERVER[HTTP_REFERER]), "18.html_form.php") === false) {
header("Location: 18.html_form.php");
exit;
}
include "db_secure.php";
if (!($connection = @ mysql_connect(DB_HOST, 'conference', 'conference'))) {
showerror();
}
$name = mysqlclean($_POST, "name", 50, $connection);
$email = mysqlclean($_POST, "email", 50, $connection);
$category = mysqlclean($_POST, "category", 50, $connection);
$id = mysqlclean($_POST, "id", 11, $connection);
if (!mysql_select_db('conference', $connection)) {
showerror();
}
$query = "UPDATE registrations2 SET name = '{$name}', email = '{$email}', category = {$category} WHERE id = {$id}";
// echo $query;
if (!mysql_query($query)) {
showerror();
}
$resultsPageURL = "18.receipt.php?name={$name}&email={$email}&category={$category}";
header("Location: {$resultsPageURL}");
exit();