-
Notifications
You must be signed in to change notification settings - Fork 0
/
vote.php
54 lines (42 loc) · 1.12 KB
/
vote.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
<?php
session_start();
require 'lib/db.php';
function convertForInsert($str)
{
if ($str != "")
{
$str = "\"".$str."\"";
}
else
{
$str = "NULL";
}
return $str;
}
$ip = convertForInsert($_SERVER["REMOTE_ADDR"]);
$vote = convertForInsert($_GET["vote"]);
$category = convertForInsert($_GET["category"]);
$sql = "
INSERT INTO tbl_Votes
(VoteID, IP_Address, Vote, Category)
VALUES
(NULL, $ip, $vote, $category);
";
$result = db::get_connection($sql);
if(!$result)
{
echo mysqli_error($result);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>BUMC Scrapbook Crop Registratrion</title>
<link href="registration.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="images/site.ico">
</head>
<body>
<p style='text-align: center;font: 25px sans-serif;font-weight: bold;color: #37347A;'>Thank you for your vote!</p>
</body>
</html>