Beste cp ik heb een vraag ondertussen ben ik ook bezig met een vieropeenrij script.
Nu vraag ik me af waar moet ik de ;return plaatsen want anders doet me right_colum raar
me script :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
<?php
if($_GET['a'] != jail){
$bajes2 = mysql_query("SELECT *,UNIX_TIMESTAMP(`baktijd`) AS `baktijd`,0 FROM `users` WHERE `login`='$data->login'");
$bajes1 = mysql_fetch_object($bajes2);
$datijd = $data->gevangenis;
$tijdverschil1 = $bajes1->baktijd-3600+$datijd-time();
if($bajes1->baktijd + $datijd > time()){
header("Location: $sitelink/jail.php");
}}
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css"></head>
<body style="margin: 0px;">
<div class="title_bg">
<div class="title">Vier op een rij</div>
</div>
<table width=100%>
<?php
{
$inzet = substr($_POST['inzet'],0,10);
$inzet = htmlspecialchars($inzet);
$verlies = $inzet;
$gewonnnen = $inzet*2;
$cijfers3 = $inzet*3;
$jackpot = $inzet*4;
$min = "1";
$max = "9";
if (isset($_POST['submit'])) {
if ($data->contant >= $verlies) {
$a = rand($min,$max);
$b = rand($min,$max);
$c = rand($min,$max);
$d = rand($min,$max);
print "<tr><td class='mainTxt' align='left'><font size=9>$a-$b-$c-$d</font></td></tr>";
if ($a == $b & $b == $c & $c == $d)
{
$win = "3";
}
else if ($a == $b & $a == $c OR $a == $b & $a == $d OR $a == $c && $a == $d OR $b == $c & $b == $d)
{
$win = "2";
}
else if ($a == $b OR $a == $c OR $a == $d OR $b == $c OR $b == $d OR $c == $d)
{
$win = "1";
}
else
{
$win = "0";
}
if ($win == "3")
{
mysql_query("UPDATE `users` SET `contant`=`contant`+{$jackpot}, `lotto`=`lotto`-1 WHERE `login`='{$data->login}'");
mysql_query("UPDATE `users` SET `bank`=`bank` -{$jackpot} WHERE `login`='$casino->owner'");
print "<br><tr><td class='mainTxt' align='left'><font size=5>Je hebt 4 dezelfde nummers en dus je inzet ver!</font></td></tr>";
}
else if ($win == "2")
{
mysql_query("UPDATE `users` SET `contant`=`contant`+{$cijfers3}, `lotto`=`lotto`-1 WHERE `login`='{$data->login}'");
mysql_query("UPDATE `users` SET `bank`=`bank` -{$cijfers3} WHERE `login`='$casino->owner'");
print "<br><tr><td class='mainTxt' align='left'><font size=4>Je hebt 3 dezelfde nummers en dus je inzet verdriedubbeld!</font></td></tr>";
}
else if ($win == "1")
{
mysql_query("UPDATE `users` SET `contant`=`contant`+{$gewonnnen}, `lotto`=`lotto`-1 WHERE `login`='{$data->login}'") or die (mysql_error());
mysql_query("UPDATE `users` SET `bank`=`bank` -{$gewonnnen} WHERE `login`='$casino->owner");
print "<br><tr><td class='mainTxt' align='left'><font size=3>Je hebt 2 dezelfde nummers en dus je inzet verdubbeld!</font></td></tr>";
}
else if ($win == "0")
{
mysql_query("UPDATE `users` SET `contant`=`contant`-{$verlies}, `lotto`=`lotto`-1 WHERE `login`='{$data->login}'") or die (mysql_error());
mysql_query("UPDATE `users` SET `bank`=`bank`+{$verlies} WHERE `login`='$casino->owner'");
print"<br><tr><td class='mainTxt' align='left'><font size=3>Je hebt het spel verloren.</font></td></tr>";
}
}
else {
print "<tr><td class='mainTxt' align='left'>Je hebt niet genoeg geld!</td></tr>";
}
}
else
{
echo "<tr><td class=mainTxt>Welkom bij vier op een rij<br>
Je ziet zo 4 random gekozen nummers. Wanneer 2 of meer cijfers het zelfde zijn, heb je gewonnen. <br>
2x hetzelfde: Je wint 2x je inzet<br> 3x hetzelfde: Je wint 3x je inzet<br> 4x hetzelfde: Je wint 4x je inzet<br>
<br><br>";
?>
<table align="center" width=100%>
<tr><td class="subTitle"><b>Vier op een rij</b></td></tr>
<tr><td class="mainTxt">
<FORM METHOD=post ACTION="">
Inzet:
<select name="inzet">
<option value="100">€ 100</option>
<option value="250">€ 250</option>
<option value="500">€ 500</option>
<option value="750">€ 750</option>
<option value="1000">€ 1000</option>
<option value="1500">€ 1500</option>
<option value="2000">€ 2000</option>
<option value="3000">€ 3000</option>
<option value="10000">€10000</option>
</select><br>
<br>
<INPUT name="submit" type="submit" VALUE="Speel het spel">
</FORM>
</td></tr>
<table>
<?
}
}
?>
</table>
</div>
<table width='100%' cellspacing='2' cellpadding='2'>
<tr>
<td class='content_bottom'></td>
</tr>
</table>
</body>
</html>
|
|
|
Laatst gewijzigd door binkkie op 2011-09-12 15:00:56
12-09-2011 14:59
Dit topic is 135 keer bekeken door 26 verschillende leden