Nieuw lid |
|
kijk ik heb een misdaad script nou moet de misdaat om de 2 min heb wat geprobeert maar het werkt niet zit vast kan iemand me helpen dit is de code:
<?php
if (($_SERVER['REQUEST_METHOD'] == 'POST') AND (ISSET($_POST['crime']))) {
$crime=$_POST['crime'];
$query="select * from crimes where crime='".$_POST['crime']."'";
$result=mysql_query($query);
$crime = mysql_fetch_assoc($result);
$random = explode(",",$crime['random']);
$getal = rand(0,5);
if(in_array($getal,$random) ){
$data->cash += $crime['cash']; echo '<script>alert("'.$crime['gelukt_text'].'"); location.href("?pagina=crime.php");</script>';
$tijd=time();
mysql_query("UPDATE `[users]` SET `bank`={$data->bank},`cash`={$data->cash}, `tijd`= ".$tijd." WHERE `login`='{$data->login}'");
print " <tr><td class=\"mainTxt\">Het bedrag is overgemaakt</td></tr>\n";
}else{
echo '<script>alert("'.$crime['mislukt_text'].'"); location.href("?pagina=crime.php");</script>';
}
}else{
$tijd=Mysql_query("select tijd from table where [users]='{$data->login}'",0);
$tijd=mysql_fetch_row($tijd);
echo $tijd[0];
if (time()-$tijd[0]>120){
echo "<table><td></td><td><form method=\"POST\">";
$query="select * from crimes";
echo mysql_num_rows($result);
$result=mysql_query($query) or die ("SQL-Fout: ". mysql_error());
while($row=mysql_fetch_assoc($result)){
echo "<input type=radio value=".$row['crime']." name=\"crime\">".$row['crime']."<br>";
}
echo "<input type=submit value=Doen!></form></td></table>";
}else{
echo"<tr><td class=\"mainTxt\">je moet 2 minuten wachten</td></tr>";
}
}
?>
<?php if (($_SERVER['REQUEST_METHOD'] == 'POST') AND (ISSET($_POST['crime']))) { $crime=$_POST['crime']; $query="select * from crimes where crime='".$_POST['crime']."'"; $random = explode(",",$crime['random']); $data->cash += $crime['cash']; echo '<script>alert("'.$crime['gelukt_text'].'"); location.href("?pagina=crime.php");</script>'; mysql_query("UPDATE `[users]` SET `bank`={$data->bank},`cash`={$data->cash}, `tijd`= ".$tijd." WHERE `login`='{$data->login}'"); print " <tr><td class=\"mainTxt\">Het bedrag is overgemaakt</td></tr>\n"; }else{ echo '<script>alert("'.$crime['mislukt_text'].'"); location.href("?pagina=crime.php");</script>'; } }else{ $tijd=Mysql_query("select tijd from table where [users]='{$data->login}'",0); if (time()-$tijd[0]>120){ echo "<table><td></td><td><form method=\"POST\">"; $query="select * from crimes"; echo "<input type=radio value=".$row['crime']." name=\"crime\">".$row['crime']."<br>"; } echo "<input type=submit value=Doen!></form></td></table>"; }else{ echo"<tr><td class=\"mainTxt\">je moet 2 minuten wachten</td></tr>"; } } ?>
|