<?php
// Einstellungen
$dbhost = 'localhost'; //mySQL IP
$dbuser = 'root'; //mySQL Username
$dbpassword = 'passwort'; //mySQL Passwort
$database = 'homepage'; //mySQL Datenbank
$coins = '100'; //Menge an Coins pro Vote
$wartezeit = '4'; //Wartezeit in Stunden
$s1 = 'Vote'; //Vote Seite 1
$s2 = 'vote'; //Vote Seite 2
$s3 = 'vote'; //Vote Seite 3
$s4 = 'vote'; //Vote Seite 4
$s5 = 'vote'; //Vote Seite 5
// 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, $s2, $s3, $s4, $s5);
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 4 Coins</title>
</head>
<body background="bg.jpg" text="grey" link="#0000CC" vlink="#000066" alink="#000000">
<h1>Vote for Us!</h1>
<center>
<font color="grey"><i>Du bekommst Pro Vote: <?php echo $coins; ?> Coins und du kannst alle <?php echo $wartezeit;?> Stunden voten.<br>
<br>Du kannst auf jeder Seite einmal Voten! </i><br /> </font>
<form action="" method="POST">
<table cellspacing=1 cellpadding=5>
<tr>
<td class=list><input type="radio" name="site" value="1"> Vote 1</td>
<td class=list><input type="radio" name="site" value="2"> Vote 2</td>
<td class=list><input type="radio" name="site" value="3"> Vote 3</td>
<td class=list><input type="radio" name="site" value="4"> Vote 4</td>
<td class=list><input type="radio" name="site" value="5"> Vote 5</td>
</tr>
</table>
<table cellspacing=1 cellpadding=5>
<tr><td class=list align=right><font size="5"><b>AccountID:</b></font></td><td class=list><input type=text name=name maxlength="15"></td></tr>
<tr><td class=listtitle align=center colspan=2><input type="image" src="vote.png" alt="Absenden"></td></tr>
</form>
</table>
</center>
</body>
</html>
Quote:
Jo moin wollte fragen ob mir jemand erklären kann wie ich die vote.php bearbeite das ich das auf meinen server dann nutzen kann? kann mir sie jemand bearbeiten ?
<?php // Einstellungen $dbhost = 'localhost'; //mySQL IP $dbuser = 'root'; //mySQL Username $dbpassword = 'passwort'; //mySQL Passwort $database = 'homepage'; //mySQL Datenbank $coins = '100'; //Menge an Coins pro Vote $wartezeit = '4'; //Wartezeit in Stunden $s1 = 'Vote'; //Vote Seite 1 $s2 = 'vote'; //Vote Seite 2 $s3 = 'vote'; //Vote Seite 3 $s4 = 'vote'; //Vote Seite 4 $s5 = 'vote'; //Vote Seite 5 // 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, $s2, $s3, $s4, $s5); 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 4 Coins</title> </head> <body background="bg.jpg" text="grey" link="#0000CC" vlink="#000066" alink="#000000"> <h1>Vote for Us!</h1> <center> <font color="grey"><i>Du bekommst Pro Vote: <?php echo $coins; ?> Coins und du kannst alle <?php echo $wartezeit;?> Stunden voten.<br> <br>Du kannst auf jeder Seite einmal Voten! </i><br /> </font> <form action="" method="POST"> <table cellspacing=1 cellpadding=5> <tr> <td class=list><input type="radio" name="site" value="1"> Vote 1</td> <td class=list><input type="radio" name="site" value="2"> Vote 2</td> <td class=list><input type="radio" name="site" value="3"> Vote 3</td> <td class=list><input type="radio" name="site" value="4"> Vote 4</td> <td class=list><input type="radio" name="site" value="5"> Vote 5</td> </tr> </table> <table cellspacing=1 cellpadding=5> <tr><td class=list align=right><font size="5"><b>AccountID:</b></font></td><td class=list><input type=text name=name maxlength="15"></td></tr> <tr><td class=listtitle align=center colspan=2><input type="image" src="vote.png" alt="Absenden"></td></tr> </form> </table> </center> </body> </html>
Quote:
Jo moin wollte fragen ob mir jemand erklären kann wie ich die vote.php bearbeite das ich das auf meinen server dann nutzen kann? kann mir sie jemand bearbeiten ?
<?php // Einstellungen $dbhost = 'localhost'; //mySQL IP $dbuser = 'root'; //mySQL Username $dbpassword = 'passwort'; //mySQL Passwort $database = 'homepage'; //mySQL Datenbank $coins = '100'; //Menge an Coins pro Vote $wartezeit = '4'; //Wartezeit in Stunden $s1 = 'Vote'; //Vote Seite 1 $s2 = 'vote'; //Vote Seite 2 $s3 = 'vote'; //Vote Seite 3 $s4 = 'vote'; //Vote Seite 4 $s5 = 'vote'; //Vote Seite 5 // 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, $s2, $s3, $s4, $s5); 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 4 Coins</title> </head> <body background="bg.jpg" text="grey" link="#0000CC" vlink="#000066" alink="#000000"> <h1>Vote for Us!</h1> <center> <font color="grey"><i>Du bekommst Pro Vote: <?php echo $coins; ?> Coins und du kannst alle <?php echo $wartezeit;?> Stunden voten.<br> <br>Du kannst auf jeder Seite einmal Voten! </i><br /> </font> <form action="" method="POST"> <table cellspacing=1 cellpadding=5> <tr> <td class=list><input type="radio" name="site" value="1"> Vote 1</td> <td class=list><input type="radio" name="site" value="2"> Vote 2</td> <td class=list><input type="radio" name="site" value="3"> Vote 3</td> <td class=list><input type="radio" name="site" value="4"> Vote 4</td> <td class=list><input type="radio" name="site" value="5"> Vote 5</td> </tr> </table> <table cellspacing=1 cellpadding=5> <tr><td class=list align=right><font size="5"><b>AccountID:</b></font></td><td class=list><input type=text name=name maxlength="15"></td></tr> <tr><td class=listtitle align=center colspan=2><input type="image" src="vote.png" alt="Absenden"></td></tr> </form> </table> </center> </body> </html>