fejl i voting script
HejJeg for denne fejl i et script:
Notice: Undefined variable: action in C:\wamp\www\Afsteming\inc\functions.php on line 69 Call Stack: 0.0008 669304 1. {main}() C:\wamp\www\Afsteming\index.php:0 0.0064 718824 2. require('C:\wamp\www\Afsteming\inc\functions.php') C:\wamp\www\Afsteming\index.php:3 Notice: Undefined index: cleanCookie in C:\wamp\www\Afsteming\inc\functions.php on line 82 Call Stack: 0.0008 669304 1. {main}() C:\wamp\www\Afsteming\index.php:0 0.0064 718824 2. require('C:\wamp\www\Afsteming\inc\functions.php') C:\wamp\www\Afsteming\index.php:3
koden er her:
liner 69 er her :
//VOTE START
if ($action == "vote"){
if (isset($_COOKIE["poll" . getPollID($pollAnswerID)])) {
echo "voted";
} else {
$query = "UPDATE pollAnswers SET pollAnswerPoints = pollAnswerPoints + 1 WHERE pollAnswerID = ".$pollAnswerID."";
mysql_query($query) or die('Error, insert query failed');
setcookie("poll" . getPollID($pollAnswerID), 1, time()+259200, "/", ".webresourcesdepot.com");
getPollResults(1);
}
}
//VOTE END
line 82 starter her
if (mysql_real_escape_string($_GET['cleanCookie']) == 1){
setcookie("poll1", "", time()-3600, "/", ".webresourcesdepot.com");
header('Location: http://webresourcesdepot.com/wp-content/uploads/file/ajax-poll-script/');
}
?>
