Hey I know that they are many threads about the theme but i need your help because i am a complete noob in AJAX / JQuery stuff ://
I just want that my site doesn´t reload when somebody votes. I have two scripts (an example for thumbsdown)
if (!isset($_COOKIE["vote" . $_GET['id'] . ""])) {
header("Location: http://localhost/votedown.php?id=" . $_GET['id'] . "");
} else {
header("Location: http://localhost/video.php?id=" . $_GET['id'] . "");
}
And here votedown.php
include('config.php');
setCookie("vote" . $_GET[ 'id' ] . "", "true", time() + 3600);
mysql_query("UPDATE videos SET `thumbsdown` = `thumbsdown`+1 WHERE id ='" . $_GET[ 'id' ] . "'");
Following on from Marabuntas answer; here's a jQuery solution (which is easier to read than the pure JavaScript version):