Foutje
Ik ben bezig met een script en hij werkt bijna helemaal perfect.
Het probleem is alleen dat als ik de Owner verander in het script dat er dan een 0 komt te staan in plaats van de naam.. Ik hoop dat jullie me hiermee kunnen helpen.
Dit is het script.
Het gaat om de updatecode op lijn 41.
Alvast bedankt.
Mvg,
Tim Kampherbeek
Code (php)
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
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
<?php
include("config.php");
$dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`pc`) AS `pc`,UNIX_TIMESTAMP(`transport`) AS `transport`,UNIX_TIMESTAMP(`bc`) AS `bc`,UNIX_TIMESTAMP(`slaap`) AS `slaap`,UNIX_TIMESTAMP(`kc`) AS `kc`,UNIX_TIMESTAMP(`start`) AS `start`,UNIX_TIMESTAMP(`crime`) AS `crime`,UNIX_TIMESTAMP(`ac`) AS `ac` FROM `users` WHERE `login`='{$_SESSION['login']}'");
$data = mysql_fetch_object($dbres);
$pro = mysql_query("SELECT * FROM `casino` WHERE `stad`='{$_GET['x']}' AND `spel`='blackjack'");
$proo = mysql_fetch_object($pro);
$owner = $_POST['owner'];
$winst = $_POST['winst'];
$min = $_POST['min'];
$max = $_POST['max'];
if ($data->level < 1000) { exit; }
if(!($_SESSION))
{
header("Location: login.php");
exit;
}
mysql_query("UPDATE `users` SET `online`=NOW(),`page`='Admin' WHERE `login`='{$data->login}'");
?>
<html>
<head>
<title>Drugsworld</title>
<link rel="stylesheet" type="text/css" href="<?php echo ($_COOKIE['v'] == 2) ? "style.php" : "style.php"; ?>">
</head>
<table width=100% cellspacing=0 cellpadding=1>
<?php
print " <tr><td class=subTitle><center><b>Admin Casino Beheer</b></center></td></tr>";
if(isset($_POST['to'])) {
if(preg_match('/^[0-9]+$/',$_POST['winst'])) {
if($member = mysql_fetch_object(mysql_query("SELECT `spel` FROM `casino` WHERE `spel`='{$_POST['to']}'"))) {
mysql_query("UPDATE `casino` SET `owner`=`owner`='{$owner}' WHERE `stad`='{$proo->stad}' AND `spel`='{$proo->spel}'");
mysql_query("UPDATE `casino` SET `winst`=`winst`='{$winst}' WHERE `stad`='{$proo->stad}' AND `spel`='{$proo->spel}'");
mysql_query("UPDATE `casino` SET `minimuminzet`=`minimuminzet`='{$min}' WHERE `stad`='{$proo->stad}' AND `spel`='{$proo->spel}'");
mysql_query("UPDATE `casino` SET `inzet`=`inzet`='{$max}' `stad`='{$proo->stad}' AND `spel`='{$proo->spel}'");
print " <tr><td class='mainTxt'>Gelukt.</td></tr>";
}
}
}
?>
<tr><td class="mainTxt" align="center">
<form method="post"><table>
<tr><td width=100>Casino:</td> <td><input type="text" name="to" value=<? echo $proo->spel ?>></td></tr>
<tr><td width=100>Owner:</td> <td><input type="text" name="owner" value=<? echo $proo->owner ?>></td></tr>
<tr><td width=100>Stad:</td> <td><input type="text" value=<? echo $proo->stad ?>></td></tr>
<tr><td width=100>Winst:</td> <td><input type="text" name="winst" value=<? echo $proo->winst ?>></td></tr>
<tr><td width=100>Minimuminzet:</td> <td><input type="text" name="min" value=<? echo $proo->minimuminzet ?>></td></tr>
<tr><td width=100>Maximuminzet:</td> <td><input type="text" name="max" value=<? echo $proo->inzet ?>></td></tr>
<tr><td></td> <td align="right"><input type="submit" value="Verander" style="width: 75px;"></td></tr>
</table></form>
</td></tr>
</table>
</body>
</html>
<?PHP
// de site word sloom dus moeten we wel alles afsluiten..
mysql_close();
// correct
?>
include("config.php");
$dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`pc`) AS `pc`,UNIX_TIMESTAMP(`transport`) AS `transport`,UNIX_TIMESTAMP(`bc`) AS `bc`,UNIX_TIMESTAMP(`slaap`) AS `slaap`,UNIX_TIMESTAMP(`kc`) AS `kc`,UNIX_TIMESTAMP(`start`) AS `start`,UNIX_TIMESTAMP(`crime`) AS `crime`,UNIX_TIMESTAMP(`ac`) AS `ac` FROM `users` WHERE `login`='{$_SESSION['login']}'");
$data = mysql_fetch_object($dbres);
$pro = mysql_query("SELECT * FROM `casino` WHERE `stad`='{$_GET['x']}' AND `spel`='blackjack'");
$proo = mysql_fetch_object($pro);
$owner = $_POST['owner'];
$winst = $_POST['winst'];
$min = $_POST['min'];
$max = $_POST['max'];
if ($data->level < 1000) { exit; }
if(!($_SESSION))
{
header("Location: login.php");
exit;
}
mysql_query("UPDATE `users` SET `online`=NOW(),`page`='Admin' WHERE `login`='{$data->login}'");
?>
<html>
<head>
<title>Drugsworld</title>
<link rel="stylesheet" type="text/css" href="<?php echo ($_COOKIE['v'] == 2) ? "style.php" : "style.php"; ?>">
</head>
<table width=100% cellspacing=0 cellpadding=1>
<?php
print " <tr><td class=subTitle><center><b>Admin Casino Beheer</b></center></td></tr>";
if(isset($_POST['to'])) {
if(preg_match('/^[0-9]+$/',$_POST['winst'])) {
if($member = mysql_fetch_object(mysql_query("SELECT `spel` FROM `casino` WHERE `spel`='{$_POST['to']}'"))) {
mysql_query("UPDATE `casino` SET `owner`=`owner`='{$owner}' WHERE `stad`='{$proo->stad}' AND `spel`='{$proo->spel}'");
mysql_query("UPDATE `casino` SET `winst`=`winst`='{$winst}' WHERE `stad`='{$proo->stad}' AND `spel`='{$proo->spel}'");
mysql_query("UPDATE `casino` SET `minimuminzet`=`minimuminzet`='{$min}' WHERE `stad`='{$proo->stad}' AND `spel`='{$proo->spel}'");
mysql_query("UPDATE `casino` SET `inzet`=`inzet`='{$max}' `stad`='{$proo->stad}' AND `spel`='{$proo->spel}'");
print " <tr><td class='mainTxt'>Gelukt.</td></tr>";
}
}
}
?>
<tr><td class="mainTxt" align="center">
<form method="post"><table>
<tr><td width=100>Casino:</td> <td><input type="text" name="to" value=<? echo $proo->spel ?>></td></tr>
<tr><td width=100>Owner:</td> <td><input type="text" name="owner" value=<? echo $proo->owner ?>></td></tr>
<tr><td width=100>Stad:</td> <td><input type="text" value=<? echo $proo->stad ?>></td></tr>
<tr><td width=100>Winst:</td> <td><input type="text" name="winst" value=<? echo $proo->winst ?>></td></tr>
<tr><td width=100>Minimuminzet:</td> <td><input type="text" name="min" value=<? echo $proo->minimuminzet ?>></td></tr>
<tr><td width=100>Maximuminzet:</td> <td><input type="text" name="max" value=<? echo $proo->inzet ?>></td></tr>
<tr><td></td> <td align="right"><input type="submit" value="Verander" style="width: 75px;"></td></tr>
</table></form>
</td></tr>
</table>
</body>
</html>
<?PHP
// de site word sloom dus moeten we wel alles afsluiten..
mysql_close();
// correct
?>
Gewijzigd op 01/01/1970 01:00:00 door Tim Kampherbeek
SET owner = owner = ....... twee keer =????
Thnx effe proberen
Dom dat ik het zelf niet heb gezien:P
Niet Bumpen.
Bumpen::
SanThe.