Hallo zusamme...
Ich habe das Vote 4 Coins von xPit
Ich habe alles eingestellt, aber sobald die User auf Absenden kommen ( vom Voten ), erscheinen sie nicht auf der Topliste, sondern erhalten diese Fehlermeldung.
Notice: Undefined index: 2 in C:\xampp\htdocs\pages\vote.php on line 109
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\index.php:196) in C:\xampp\htdocs\pages\vote.php on line 109
Die Coins bekommen sie danach, der Server aber nicht die Votes.
Hier nochmal das ganze Vote 4 Coins System
$s1 = 'Votelink'; //Vote Seite 1
// Einstellungen Ende
//Ab hier NICHTS mehr verändern!
$conn = mysql_connect($dbhost, $dbuser, $dbpassword) or die ('mySQL Connecting Error');
mysql_select_db($database);
$ip = $_SERVER['REMOTE_ADDR'];
$site = $_POST['site'];
$website = array(1, $s1);
if($site) {
$wartezeit = $wartezeit * 3600;
$time = time();
$earnedpoints = false;
$account = $_POST['name'];
$account = mysql_real_escape_string($account);
if ($account == "") {
echo 'Enter your AccountID!';
exit();
}
$query = mysql_query("SELECT *, SUM(`times`) as amount FROM vote WHERE account='$account' OR ip='$ip'");
$lasttime = mysql_fetch_array($query);
$amount = $lasttime['amount'];
$insertnew = false;
if ($amount == "") {
$insertnew = true;
}
$timecalc = $time - $lasttime['Site' . $site];
if (!$insertnew) {
if ($timecalc < $wartezeit) {
echo '<html>
<head>
<title>Vote for Coins</title>
</head>
<body background="bg.jpg" text="grey" link="#0000CC" vlink="#000066" alink="#000000">
<h1>Vote for Us!</h1>';
echo ' Hallo '. $account .' Du hast bereits mit diesem Account: ('. $account .') oder deiner IP: ('. $ip .') in den letzten ' . $wartezeit / 3600 . ' Stunden bereits gevotet.!';
echo ' <br><br>Letzter Vote am: '. date('M d\, h:i:s A', $lasttime['Site' . $site]) .'';
echo '<html>';
echo '<head>';
echo '</head>';
echo '<body>';
echo '</body>';
echo '</html>';
exit();
} else {
$update = mysql_query("UPDATE vote SET account='$account', Site" . $site . "='$time', times=times+1 WHERE ip='$ip'");
if (!$update) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $update;
die($message);
} else {
$earnedpoints = true;
}
}
} else {
$success = mysql_query("INSERT INTO vote (`account`, `ip`, `Site" . $site . "`, `times`) VALUES ('$account', '$ip', '$time', 1)");
if (!$success) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $success;
die($message);
} else {
$earnedpoints = true;
}
}
if ($earnedpoints) {
$points = mysql_query("UPDATE account.account SET coins = coins + " . $coins . " WHERE login='$account'");
if (!$points) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
mysql_close($conn);
header("Location: http://" . $website[$site] . "");
exit();
} else {
echo 'There was an error processing your request.';
exit();
}
}
?>
<html>
<head>
<title>Vote for Coins</title>
</head>
<body background="bg.jpg" text="grey" link="#0000CC" vlink="#000066" alink="#000000">
<font color="white"><h1>Vote for Us!</h1></font>
<center>
<b><font color="white"><i>Du bekommst Pro Vote: <?php echo $coins; ?> Coins und du kannst alle <?php echo $wartezeit;?> Stunden voten.<br>
<br>Du kannst nur einmal Voten! </i><br /> </font> </b>
<form action="" method="POST">
<table cellspacing=50 cellpadding=50>
<tr>
<font color="white"<td class=list><input type="radio" name="site" value="2"> VOTEN</td></font>
</tr>
</table>
<table cellspacing=1 cellpadding=-50>
<tr><td class=list align=right><font color="white"><font size="5"<b>AccountID:</b></font></td><td class=list><input type=text name=name maxlength="15"></td></tr> </font>
<tr><td class=listtitle align=center colspan=5><input type="image" src="vote.png" alt="Absenden"></td></tr>
</form>
</table>
</center>
</body>
</html>