- Joined
- Jun 11, 2008
- Messages
- 647
- Reaction score
- 182
Здравейте, Наскоро ми се наложи да правя играта Черно или Червено.
Реших да я споделя с Вас,с лек едит на база от данните може да си я направите да дава кредити.
Реших да я споделя с Вас,с лек едит на база от данните може да си я направите да дава кредити.
PHP:
<?php
/* Black or Red / Free Source
Mortred (Даниел Маринов) */
require './config.php';
include './securexss.php';
$id = stripslashes($username);
$id = stripslashes($value);
$id = stripslashes($submit);
$id = str_replace("drop", "", $id);
$id = str_replace(";", "", $id);
$id = str_replace("shutdown", "", $id);
$id = str_replace("UPDATE", "", $id);
if (eregi("[^a-zA-Z0-9_-]", $id))
{
header ("Location: ../index.php?browsergame=accessdenied");
}
else
{
print 'BET SETTINGS' . '<br>';
print '<form method="post">
<select name = "Card" ><option value="red" name="red"> Red </option> <option value="black" name ="black"> Black </option></select>
<input type="submit" name ="25" value="25">
<input type="submit" name ="50" value="50">
<input type="submit" name ="100" value="100">
<input type="submit" name ="200" value="200">
</form>';
if ($username == TRUE) {
$username = $_SESSION['username'];
$value = $_POST['Card'];
$submit = array('fbet' => $_POST['25'], 'sbet' => $_POST['50'], 'tbet' => $_POST['100'], 'lbet' => $_POST['200']);
$sql = mysql_query("SELECT * FROM userbase WHERE username = '$username'");
$res = mysql_fetch_array($sql);
$result = "$res[5]" - "$res[6]";
$system = rand(1, 2);
print "
<table class=sort align=center>
<th> Win Pts</th> <th>Loose Pts</th> <th> Result </th> <th> Play </th><tr>
<td> $res[5]</td> <td> $res[6]</td> <td> $result</td> <td> $res[7]</td></tr>
</table>";
switch ($submit) {
case ($submit['fbet'] == TRUE ) : $bet = 25; break;
case ($submit['sbet'] == TRUE ) : $bet = 50; break;
case ($submit['tbet'] == TRUE ) : $bet = 100; break;
case ($submit ['lbet'] == TRUE ) :$bet = 200; break;
default : $bet = 0 . $submit = NULL ; break;
}
switch ($value) {
case ($value == red) : $value = 1; break;
case ($value == black) : $value = 2; break;
default : print "Select Black or Red to play for Points"; break;
}
switch ($bet) {
case 0 : print " " ; break;
case ( $bet > $res[4] ) : print "Please vote for us ,or use your personal Link to earn pts." . $submit = NULL ; break;
}
if(isset($submit)) {
switch ($system) {
case 1 : print '<img src ="https://i.imgsafe.org/86ba3456d2.png"> <br>'; break;
case 2 : print '<img src="https://i.imgsafe.org/86bcd2e864.png"> <br>'; break;
}
switch ($system && $value) {
case ($system == $value) :
print "<font color='green'> <b>You succesfuly win $bet Points </b></font>";
$query = mysql_query("UPDATE userbase SET Points = Points + '$bet' , win = win + '$bet' ,plays = plays + 1 WHERE username = '$username'");
break;
case ($system != $value) :
print "<font color='darkred'> <b>You loose $bet Points </font></b>";
$query = mysql_query("UPDATE userbase SET Points = Points - '$bet' , lose = lose + '$bet' , plays = plays + 1 WHERE username = '$username'");
}
}
}
else {
print "Please Login to system";
}
}