forked from gopi1410/FEAT-V
-
Notifications
You must be signed in to change notification settings - Fork 0
/
castvote_cult.php
45 lines (39 loc) · 1.05 KB
/
castvote_cult.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
<?php
session_start();
include('dbconnect.php');
$total=$_POST['total'];
$next=$_POST['next'];
$exec="cultural";
if(isset($_POST['pref0'])) {
$pref0=$_POST['pref0'];
$sql="UPDATE nopref SET votes = votes + 1 WHERE post='".$pref0."'";
}
else {
if(isset($_POST['pref1'])) {
$pref1=$_POST['pref1'];
}
if(isset($_POST['pref2'])) {
$pref2=$_POST['pref2'];
}
if($pref1==21 && $pref2==22) {
$sql="UPDATE ".$exec." SET votes = votes + 1 WHERE id='1'";
}
if($pref1==21 && $pref2==23) {
$sql="UPDATE ".$exec." SET votes = votes + 1 WHERE id='2'";
}
if($pref1==22 && $pref2==21) {
$sql="UPDATE ".$exec." SET votes = votes + 1 WHERE id='3'";
}
if($pref1==22 && $pref2==23) {
$sql="UPDATE ".$exec." SET votes = votes + 1 WHERE id='4'";
}
if($pref1==23 && $pref2==21) {
$sql="UPDATE ".$exec." SET votes = votes + 1 WHERE id='5'";
}
if($pref1==23 && $pref2==22) {
$sql="UPDATE ".$exec." SET votes = votes + 1 WHERE id='6'";
}
}
mysql_query($sql) or die(mysql_error());
header("Location:".$next.".php");
?>