-
Notifications
You must be signed in to change notification settings - Fork 3
/
up.php
27 lines (22 loc) · 807 Bytes
/
up.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
<?php
session_start();
define('DB_HOST', 'localhost');
define('DB_NAME', 'practice');
define('DB_USER', 'root');
define('DB_PASSWORD', '');
if (isset($_POST['submit'])) {
$con = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or die("Failed to connect to MySQL: " . mysql_error());
$db = mysql_select_db(DB_NAME, $con) or die("Failed to connect to MySQL: " . mysql_error());
if($_SESSION['up']==0)
{
$query1 = mysql_query("UPDATE filet SET vote = 1 WHERE filename='Presentation3.pptx';" );
$_SESSION['up']=$_SESSION['up']+1;
}
else {
$query1 = mysql_query("UPDATE filet SET vote = 1 WHERE filename='imagetopdf.pdf';" );
}
echo "<script type='text/javascript'>
window.location = 'new.php';
</script>";
}
?>