2017-02-13, 01:56 PM
This is my page of like.php
Itì's a like system by click on the button linked to the id of the table. Except that when I go to click to increase the score and I find myself no longer logged in. Its operation should instead allow me to vote once a day. How can I fix?
<?php
define("IN_MYBB", 1);
include("global.php");
eval('$page = "'. $templates->get("home").'";');
output_page($page);
$cookies = my_setcookie($prefix."mybbuser", $user['uid']."_".$user['loginkey'], $remember);
$connessione = mysql_connect("***", "***", "***");
mysql_select_db("***", $connessione);
$id = $_GET['id'];
$voto = $_GET['voto'];
$risultato = mysql_query("SELECT voto FROM serverh", $connessione);
if ($cookies == TRUE)
{
echo "<script type='text/javascript'>alert('You have already voted!');</script>
<meta http-equiv=\"refresh\" content=\"0;URL=/home.php\">";
}
else
{
mysql_query("UPDATE serverh SET voto = voto +1 WHERE id = '$id'");
my_setcookie("$cookies", time() + 86400);
header('location:/home.php');
}
mysql_close($con);
?>
Itì's a like system by click on the button linked to the id of the table. Except that when I go to click to increase the score and I find myself no longer logged in. Its operation should instead allow me to vote once a day. How can I fix?