Parse errors
gamesty - 29/07/2005 10:34
Onbekend
Ik heb deze error:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /vhost/usr/thefarwest/listtest.php on line 153
Maar ik zie hier niets verkeerd aan:
echo "<td align=\"center\" class=\"mainTxt\" width=100>".$_SESSION["login"]."</td>";
echo "<td align=\" center\" class=\" mainTxt\" width=100>" . $_SESSION [ "login" ] . "</td>" ;
46 antwoorden
Gesponsorde links
RickyB - 29/07/2005 10:44
Onbekend
is het niet een "}" die je bent vergeten te sluiten?
rambo - 29/07/2005 11:43
HTML beginner
Probeer het eens zo:
echo "<td align=\"center\" class=\"mainTxt\" width=100>".$_SESSION['login']."</td>";
gamesty - 29/07/2005 12:14
Onbekend
// toon een rij met de kolommen: nummer, loginnaam, type, money en power van de user met nummer $j
print <<<ENDHTML
<tr><td align="center" class=\"mainTxt\" width=20>$j</td>
<td class="mainTxt"><a href="profile.php?x={$info->login}">$login</a></td>
<td align="center" class=\"mainTxt\" width=150>$type</td>
<td align="center" class=\"mainTxt\" width=150>$leven%</td>
<td align="center" class=\"mainTxt\" width=100>$clan</td>
<td align="center" class=\"mainTxt\" width=100>$money$</td>
<td align="center" class=\"mainTxt\" width=100>$power</td>
ENDHTML;
// DEBUG COMMENT: hier gaat SESSION de mist in
// DEBUG CODE:
echo "<td align=\"center\" class=\"mainTxt\" width=100>".$_SESSION["login"]."</td>";
// als type niet is: HaCkEr OF (type is HaCkEr EN
if(($data->type != 3 || ($data->type == 3 && $info->type != 3)) && round($data->signup/3600-time()/3600) + 12 <= 0 && round($info->signup/3600-time()/3600) + 12 <= 0 && ($info->clan != $data->clan || $info->clan == ""))
print " <td align="center" class="mainTxt"><a href="attack.php?x={$info->login}">Attack</a></td></tr>\n\n";
else
print " </tr>\n\n";
}
// toon een rij met de kolommen: nummer, loginnaam, type, money en power van de user met nummer $j
<tr><td align="center" class=\"mainTxt\" width=20>$j</td>
<td class="mainTxt"><a href="profile.php?x={$info->login}">$login</a></td>
<td align="center" class=\"mainTxt\" width=150>$type</td>
<td align="center" class=\"mainTxt\" width=150>$leven%</td>
<td align="center" class=\"mainTxt\" width=100>$clan</td>
<td align="center" class=\"mainTxt\" width=100>$money$</td>
<td align="center" class=\"mainTxt\" width=100>$power</td>
ENDHTML ;
// DEBUG COMMENT: hier gaat SESSION de mist in
// DEBUG CODE:
echo "<td align=\" center\" class=\" mainTxt\" width=100>" . $_SESSION [ "login" ] . "</td>" ;
// als type niet is: HaCkEr OF (type is HaCkEr EN
if ( ( $data -> type != 3 || ( $data -> type == 3 && $info -> type != 3 ) ) && round ( $data -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && round ( $info -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && ( $info -> clan != $data -> clan || $info -> clan == "" ) ) print " <td align=" center
" class=" mainTxt
"><a href=" attack
. php?x
= { $info -> login } ">Attack</a></td></tr>\n \n " ; else
}
@Rambo:Niets
rambo - 29/07/2005 12:18 (laatste wijziging 29/07/2005 12:20)
HTML beginner
<?php
// toon een rij met de kolommen: nummer, loginnaam, type, money en power van de user met nummer $j
?>
<tr><td align="center" class="mainTxt" width="20"><?=$j;?></td>
<td class="mainTxt"><a href="profile.php?x=<?={$info->login};?>"><?=$login;?></a></td>
<td align="center" class="mainTxt" width="150"><?=$type;?></td>
<td align="center" class="mainTxt" width="150"><?=$leven%;?></td>
<td align="center" class="mainTxt" width="100"><?=$clan;?></td>
<td align="center" class="mainTxt" width="100"><?=$money$;?></td>
<td align="center" class="mainTxt" width="100"><?=$power;?></td>
<?php
// DEBUG COMMENT: hier gaat SESSION de mist in
// DEBUG CODE:
echo "<td align=\"center\" class=\"mainTxt\" width=100>".$_SESSION['login']."</td>";
// als type niet is: HaCkEr OF (type is HaCkEr EN
if(($data->type != 3 || ($data->type == 3 && $info->type != 3)) && round($data->signup/3600-time()/3600) + 12 <= 0 && round($info->signup/3600-time()/3600) + 12 <= 0 && ($info->clan != $data->clan || $info->clan == ""))
print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
else
print " </tr>\n\n";
}
<?php
// toon een rij met de kolommen: nummer, loginnaam, type, money en power van de user met nummer $j
?>
<tr><td align="center" class="mainTxt" width="20"><?= $j ; ?> </td>
<td class="mainTxt"><a href="profile.php?x=<?= { $info -> login } ; ?> "><?= $login ; ?> </a></td>
<td align="center" class="mainTxt" width="150"><?= $type ; ?> </td>
<td align="center" class="mainTxt" width="150"><?= $leven %; ?> </td>
<td align="center" class="mainTxt" width="100"><?= $clan ; ?> </td>
<td align="center" class="mainTxt" width="100"><?= $money $; ?> </td>
<td align="center" class="mainTxt" width="100"><?= $power ; ?> </td>
<?php
// DEBUG COMMENT: hier gaat SESSION de mist in
// DEBUG CODE:
echo "<td align=\" center\" class=\" mainTxt\" width=100>" . $_SESSION [ 'login' ] . "</td>" ;
// als type niet is: HaCkEr OF (type is HaCkEr EN
if ( ( $data -> type != 3 || ( $data -> type == 3 && $info -> type != 3 ) ) && round ( $data -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && round ( $info -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && ( $info -> clan != $data -> clan || $info -> clan == "" ) ) print " <td align=\" center\" class=\" mainTxt\" ><a href=\" attack.php?x={$info->login} \" >Attack</a></td></tr>\n \n " ; else
}
smoos - 29/07/2005 12:19 (laatste wijziging 29/07/2005 12:20)
PHP gevorderde
woow een antiek criminals script XD
zal ik je maar ff helpe
je moet ff 2 slashforward voor die lijn doen ;)
anders krijg je in het spel problemen dat je niet op je eigen acount blijft maar opeens op iemands anders acount zit.
dus zo word het:
<?php
// DEBUG COMMENT: hier gaat SESSION de mist in
// DEBUG CODE:
// echo "<td align=\"center\" class=\"mainTxt\" width=100>".$_SESSION["login"]."</td>";
// als type niet is: HaCkEr OF (type is HaCkEr EN
if(($data->type != 3 || ($data->type == 3 && $info->type != 3)) && round($data->signup/3600-time()/3600) + 12 <= 0 && round($info->signup/3600-time()/3600) + 12 <= 0 && ($info->clan != $data->clan || $info->clan == ""))
?>
<?php
// DEBUG COMMENT: hier gaat SESSION de mist in
// DEBUG CODE:
// echo "<td align=\"center\" class=\"mainTxt\" width=100>".$_SESSION["login"]."</td>";
// als type niet is: HaCkEr OF (type is HaCkEr EN
if ( ( $data -> type != 3 || ( $data -> type == 3 && $info -> type != 3 ) ) && round ( $data -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && round ( $info -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && ( $info -> clan != $data -> clan || $info -> clan == "" ) ) ?>
zonder die <php en ?> natuurlijk XD
suc6
gamesty - 29/07/2005 13:52
Onbekend
Nu zou er hier ook nog een fout in zitten:
// als type niet is: HaCkEr OF (type is HaCkEr EN
if(($data->type != 3 || ($data->type == 3 && $info->type != 3)) && round($data->signup/3600-time()/3600) + 12 <= 0 && round($info->signup/3600-time()/3600) + 12 <= 0 && ($info->clan != $data->clan || $info->clan == ""))
print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
else
print " </tr>\n";
}
// als type niet is: HaCkEr OF (type is HaCkEr EN
if ( ( $data -> type != 3 || ( $data -> type == 3 && $info -> type != 3 ) ) && round ( $data -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && round ( $info -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && ( $info -> clan != $data -> clan || $info -> clan == "" ) ) print " <td align=\" center\" class=\" mainTxt\" ><a href=\" attack.php?x={$info->login} \" >Attack</a></td></tr>\n \n " ; else
}
haytjes - 29/07/2005 13:55 (laatste wijziging 29/07/2005 14:00)
JS gevorderde
<?
if(($data->type != 3 || ($data->type == 3 && $info->type != 3)) && round($data->signup/3600-time()/3600) + 12 <= 0 && round($info->signup/3600-time()/3600) + 12 <= 0 && ($info->clan != $data->clan || $info->clan == ""))
{ ////// '{' dit vergeten te zetten
print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
else
print " </tr>\n";
}
?>
<?
if ( ( $data -> type != 3 || ( $data -> type == 3 && $info -> type != 3 ) ) && round ( $data -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && round ( $info -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && ( $info -> clan != $data -> clan || $info -> clan == "" ) ) { ////// '{' dit vergeten te zetten
print " <td align=\" center\" class=\" mainTxt\" ><a href=\" attack.php?x={$info->login} \" >Attack</a></td></tr>\n \n " ; else
}
?>
gamesty - 29/07/2005 13:57
Onbekend
ik probeer even
haytjes - 29/07/2005 14:00 (laatste wijziging 29/07/2005 14:02)
JS gevorderde
nee, klein foutje je moet oftewel die laatste '}' en de dene dat ik erbij heb gezet wegdoen
of bij else -> }else{
<?
if(($data->type != 3 || ($data->type == 3 && $info->type != 3)) && round($data->signup/3600-time()/3600) + 12 <= 0 && round($info->signup/3600-time()/3600) + 12 <= 0 && ($info->clan != $data->clan || $info->clan == ""))
{ ////// '{' dit vergeten te zetten
print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
}else{
print " </tr>\n";
}
?>
<?
if ( ( $data -> type != 3 || ( $data -> type == 3 && $info -> type != 3 ) ) && round ( $data -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && round ( $info -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && ( $info -> clan != $data -> clan || $info -> clan == "" ) ) { ////// '{' dit vergeten te zetten
print " <td align=\" center\" class=\" mainTxt\" ><a href=\" attack.php?x={$info->login} \" >Attack</a></td></tr>\n \n " ; } else {
}
?>
of
<?
if(($data->type != 3 || ($data->type == 3 && $info->type != 3)) && round($data->signup/3600-time()/3600) + 12 <= 0 && round($info->signup/3600-time()/3600) + 12 <= 0 && ($info->clan != $data->clan || $info->clan == ""))
print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
else
print " </tr>\n";
?>
<?
if ( ( $data -> type != 3 || ( $data -> type == 3 && $info -> type != 3 ) ) && round ( $data -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && round ( $info -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && ( $info -> clan != $data -> clan || $info -> clan == "" ) ) print " <td align=\" center\" class=\" mainTxt\" ><a href=\" attack.php?x={$info->login} \" >Attack</a></td></tr>\n \n " ; else
?>
gamesty - 29/07/2005 14:40
Onbekend
Nu ik toch bezig ben met fouten te ontdekken:
Hier moet ook 1 inzitten:
<? php
else
print "<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=\". ($begin/30-1) .""><<</a> ";
?>
<? php
else
print "<a href=\" list.php?s={$_GET['s']} &q={$_GET['q']} &p=\" . ($begin /30-1) ." "><<</a> " ; ?>
P.S. Ik post niet onmiddelijk de fouten hier.Ik zoek zelf ook wat.
gamesty - 29/07/2005 14:50 (laatste wijziging 29/07/2005 14:52)
Onbekend
echo() is eigenlijk geen functie (het is een language construct), dus je hoeft geen haakjes te gebruiken. Sterker nog, als je meer dan één parameter gebruikt mag je geen haakjes gebruiken. Het is niet mogelijk echo() te gebruiken als een variabele functie, maar dat kan wel met print().
EDIT: Nog altijd de fout:Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /vhost/usr/thefarwest/listtest.php on line 196
gamesty - 29/07/2005 14:54
Onbekend
Ok,Iemand een oplossing op mijn error?
Simon - 29/07/2005 14:56
PHP expert
doe eens $_SESSION['login']
met ''
haytjes - 29/07/2005 14:57 (laatste wijziging 29/07/2005 14:59)
JS gevorderde
.. &p=\". ( ...
to
... &p=\"". ( ...
je escaped je 1ste " en deed dan hem niet open om die var daar te zetten
heel de code:
<?
print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=\"".($begin/30-1)."\"><<</a> ");
?>
<?
print ( "<a href=\" list.php?s={$_GET['s']} &q={$_GET['q']} &p=\" " . ( $begin / 30 - 1 ) . "\" ><<</a> " ) ; ?>
gamesty - 29/07/2005 15:04
Onbekend
Thanks,Heb met dat voorbeeld nog een deel andere kunnen oplossen.
Behalve deze:
else
print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=". ($begin/30+1) .\"">>></a>");
}
else
print ( "<a href=\" list.php?s={$_GET['s']} &q={$_GET['q']} &p=" . ( $begin / 30 + 1 ) . \
"" >& #62;></a>"); }
Er is iets denk ik met >> Want de error is Parse error: parse error, unexpected '&' in /vhost/usr/thefarwest/listtest.php on line 208
gamesty - 29/07/2005 15:21 (laatste wijziging 29/07/2005 15:23)
Onbekend
Werkt!
Nu krijg ik al de layout:p Enkel nog geen inhoud behalve deze error dan:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /vhost/usr/thefarwest/list.php on line 83
EDIT: Dit is lijn 81 tot 83:
$user = $_SESSION['login'];
for($j=$begin+1; $info = mysql_fetch_object($dbres); $j++)
{
$user = $_SESSION [ 'login' ] ;
{
Gerard - 29/07/2005 15:23
Ouwe rakker
dan is je query waarschijnlijk mislukt, zet erboven eens;
echo mysql_error();
gamesty - 29/07/2005 15:31
Onbekend
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin,30");
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin ,30" ) ;
haytjes - 29/07/2005 15:36
JS gevorderde
FROM `[users]` mag dat ??
en zet er nu een keer or die(mysql_error()); achter
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin,30") or die(mysql_error());
en zeg dan wat je als output krijg
gamesty - 29/07/2005 15:41
Onbekend
Als ik er or die(mysql_error()); krijg ik een errorvrije pagina
Maar nog altijd geen memberlijst
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /vhost/usr/thefarwest/listtest.php on line 83
Dolfje - 29/07/2005 15:50 (laatste wijziging 29/07/2005 15:50)
PHP ver gevorderde
for($j=$begin+1; $info = mysql_fetch_object($dbres); $j++)
{
waarom doe je niet:
<?
$j=$begin+1;
while( $info = mysql_fetch_object($dbres) )
{
...
$j++;
}?>
<?
$j = $begin + 1 ;
{
...
$j ++;
} ?>
ps: je weet toch zeker dat je $dbres niet overschrijft:?:
gamesty - 29/07/2005 17:12 (laatste wijziging 29/07/2005 19:16)
Onbekend
Sorry,Maar ik post eens het hele scriptje.
<?php /* ------------------------- */
include("_include-config.php");
if(! check_login()) {
header("Location: login.php");
exit;
}
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
/* ------------------------- */ ?>
<html>
<head>
<title>[( Farwest )]</title>
</head>
<head>
<title> [(Farwest)] </title>
<link rel="stylesheet" type="text/css" href="<?php echo ($_COOKIE['v'] == 2) ? "css-v2.css" : "css-v1.css"; ?>">
</head>
<body style="background: #DDDDDD; margin: 0px;">
<table width=100%>
<tr><td align="center">
<form action="list.php" method="get">
Voorbeeld: "<b>a*</b>" zal een lijst geven van namen die beginnen met een A<br>
<input type="hidden" name="s" value="search"><input type="text" name="q" value="<?php echo $_REQUEST['q']; ?>"> <input type="submit" value="Zoek!">
</form>
</td></tr>
</table>
<table width=100%>
<tr><td align="center" class="subTitle" style="letter-spacing: normal;" width=15><b>#</b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center"><a href="list.php?s=login"><b><font color=white>Nickname</a></b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center"><b>Type</b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=150><a href="list.php?s=leven"><b><font color=white>leven</b></a></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=100><a href="list.php?s=money"><b><font color=white>Clan</b></a></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=75><a href="list.php?s=power"><b><font color=white>Geld</b></a></td></tr>
<?php /* ------------------------- */
echo mysql_error();
$begin = ($_GET['p'] >= 0) ? $_GET['p']*30 : 0;
if($_GET['s'] == "login")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin,30");
else if($_GET['s'] == "money")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `cash`+`bank` DESC,`login` ASC LIMIT $begin,30");
else if($_GET['s'] == "type")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `type`,`login` LIMIT $begin,30");
else if($_GET['s'] == "health")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `health`,`login` LIMIT $begin,30");
else if($_GET['s'] == "clicks")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `clicks` DESC,`login` ASC LIMIT $begin,30");
else if($_GET['s'] == "clan")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `clan` DESC,`login` ASC LIMIT $begin,30");
else if($_GET['s'] == "contant")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `cash` DESC,`login` ASC LIMIT $begin,30");
else if($_GET['s'] == "online")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`showonline`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
else if($_GET['s'] == "admin")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
else if($_GET['s'] == "search")
{
$_GET['q'] = preg_replace('/*/','%',$_GET['q']);
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']}' ORDER BY `login` LIMIT $begin,30");
}
else
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`l
evel`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin,30");
$user = $_SESSION['login'];
for($j=$begin+1; $info = mysql_fetch_object($dbres); $j++)
{
// ????
$login = ($info->showonline == 0 && $data->level == 0x80 && $_GET['s'] == "online") ? "{$info->login} *" : $info->login;
// onthoud admins dikgedrukt en met *, als betreffende user dat is
$login = ($info->level & 0x80) ? "<b><font color=red>$login* </b>" : $login;
$login = ($info->level == 5) ? "<b><font color=#Green>$login* </b>" : $login;
$login = ($info->level == 100) ? "<b><font color=#000000>$login*</b>" : $login;$leven = $info->leven;
$contant = $info->cash+$info->contant;
$clan = $info->clan;
$clicks = $info->clicks;
// maak een array met typen
$type = Array("","Hippie","Skinhead","FBI Agent");
// onthoud betreffende type
$type = $type[$info->type];
// rond berekening van power af op gehele waarde en onthoud deze van de betreffende typen
$power = round(($info->attack+$info->defence)/2+$info->clicks*5);
// money is bank+cash waarde van betreffende coureur
$money = $info->cash+$info->bank;
if ($power <= 100) {
$rank = "Zwerver";
} elseif ($power > 100 AND $power <= 300) {
$rank = "Bedelaar";
} elseif ($power > 300 AND $power <= 700) {
$rank = "Crimineel";
} elseif ($power > 700 AND $power <= 1900) {
$rank = "Zakkenroller";
} elseif ($power > 1300 AND $power <= 2800) {
$rank = "Tuig";
} elseif ($power > 2000 AND $power <= 3900) {
$rank = "Geweldadig";
} elseif ($power > 2800 AND $power <= 4750) {
$rank = "Autodief";
} elseif ($power > 3700 AND $power <= 6700) {
$rank = "Drugsdealer";
} elseif ($power > 4700 AND $power <= 7800) {
$rank = "Gangster";
} elseif ($power > 5800 AND $power <= 9000) {
$rank = "Overvaller";
} elseif ($power > 6000 AND $power <= 1500) {
$rank = "Bendeleider";
} elseif ($power > 7300 AND $power <= 18200) {
$rank = "Huurmoordenaar";
} elseif ($power > 25200) {
$rank = "God";
}
// toon een rij met de kolommen: nummer, loginnaam, type, money en power van de user met nummer $j
?>
<tr><td align="center" class=\"mainTxt\" width="20"><?=$j;?></td>
<td class=\"mainTxt\"><a href="profile.php?x={$info->login}"><?=$login;?></a></td>
<td align="center" class=\"mainTxt\" width="150"><?=$type;?></td>
<td align="center" class=\"mainTxt\" width="150"><?=$leven;?>%</td>
<td align="center" class=\"mainTxt\" width="100"><?=$clan;?></td>
<td align="center" class=\"mainTxt\" width="100"><?=$money;?>$</td>
<td align="center" class=\"mainTxt\" width="100"><?=$power;?></td>
<?php
// DEBUG COMMENT: hier gaat SESSION de mist in
// DEBUG CODE:
echo "<td align=\"center\" class=\"mainTxt\" width=100>".$_SESSION['login']."</td>";
// als type niet is: HaCkEr OF (type is HaCkEr EN
if(($data->type != 3 || ($data->type == 3 && $info->type != 3)) && round($data->signup/3600-time()/3600) + 12 <= 0 && round($info->signup/3600-time()/3600) + 12 <= 0 && ($info->clan != $data->clan || $info->clan == ""))
print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
else
print " </tr>\n\n";
}
// als type niet is: HaCkEr OF (type is HaCkEr EN
if(($data->type != 3 || ($data->type == 3 && $info->type != 3)) && round($data->signup/3600-time()/3600) + 12 <= 0 && round($info->signup/3600-time()/3600) + 12 <= 0 && ($info->clan != $data->clan || $info->clan == ""))
print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
else
print " </tr>\n";
if($_GET['s'] == "online")
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300");
else if($_GET['s'] == "online")
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=1");
else if($_GET['s'] == "admin")
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
else if($_GET['s'] == "search")
{
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']}' ORDER BY `login`");
$_GET['q'] = preg_replace('/%/','*',$_GET['q']);
}
else
$dbres = mysql_query("SELECT id FROM `[users]` WHERE `activated`=1");
print "</table>\n\n<table width=100%>\n <tr><td class=\"mainTxt\" align=\"center\">";
if(mysql_num_rows($dbres) <= 30)
print "< 1 ></td></tr></table>\n";
else
{
if($begin/30 == 0)
print "<< ";
else
print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=\""
.($begin/30-1)."\"><<</a> ");
for($i=0; $i<mysql_num_rows($dbres)/30; $i++)
{
print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=$i\">". ($i+1) ."</a> ");
}
if($begin+30 >= mysql_num_rows($dbres))
print ">> ";
else
print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=". ($begin/30+1) ."\">>></a>");
}
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300");
$online = mysql_num_rows($dbres);
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=0");
$anonymous = mysql_num_rows($dbres);
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `level`=255");
$admins = mysql_num_rows($dbres);
/* ------------------------- */ ?>
</table>
<table width=100%>
<tr><td align="center"><a href="list.php?s=online"><b><?php print $online; ?> leden online</b></a></td></tr>
<tr><td align="center"><a href="list.php?s=admin"><b><?php print $admins; ?> beheerder(s) online</b></a></td></tr>
<tr><td align="center"><font color=darkblue><b>Admins worden aangegeven als:</b><font color=red><b>Loginnaam<img src="images/diamant.gif" width=10 height=10 border=0 alt="diamant"></b></font></td></tr>
<tr><td align="center"><font color=darkblue><b>Betaalde Accounts als:</b><font color=#4DFF00<b>Loginnaam<img src="images/ster2.gif" width=10 height=10 border=0 alt="/images/ster2.gif"></b></font></td></tr>
</table>
<?php
$login = $user;
// DEBUG CODE:
// echo $_SESSION["login"];
?>
</body>
</html>
<span Style="display: none">
<?php /* ------------------------- */
include ( "_include-config.php" ) ;
if ( ! check_login( ) ) {
header ( "Location: login.php" ) ; }
mysql_query ( "UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login} '" ) ;
/* ------------------------- */ ?>
<html>
<head>
<title>[( Farwest )]</title>
</head>
<head>
<title> [(Farwest)] </title>
<link rel="stylesheet" type="text/css" href="
<?php echo ( $_COOKIE [ 'v' ] == 2 ) ?
"css-v2.css" : "css-v1.css" ; ?> ">
</head>
<body style="background: #DDDDDD; margin: 0px;">
<table width=100%>
<tr><td align="center">
<form action="list.php" method="get">
Voorbeeld: "<b>a*</b>" zal een lijst geven van namen die beginnen met een A<br>
<input type="hidden" name="s" value="search"><input type="text" name="q" value="
<?php echo $_REQUEST [ 'q' ] ; ?> "> <input type="submit" value="Zoek!">
</form>
</td></tr>
</table>
<table width=100%>
<tr><td align="center" class="subTitle" style="letter-spacing: normal;" width=15><b>#</b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center"><a href="list.php?s=login"><b><font color=white>Nickname</a></b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center"><b>Type</b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=150><a href="list.php?s=leven"><b><font color=white>leven</b></a></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=100><a href="list.php?s=money"><b><font color=white>Clan</b></a></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=75><a href="list.php?s=power"><b><font color=white>Geld</b></a></td></tr>
<?php /* ------------------------- */
$begin = ( $_GET [ 'p' ] >= 0 ) ? $_GET [ 'p' ] * 30 : 0 ;
if ( $_GET [ 's' ] == "login" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "money" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `cash`+`bank` DESC,`login` ASC LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "type" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `type`,`login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "health" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `health`,`login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "clicks" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `clicks` DESC,`login` ASC LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "clan" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `clan` DESC,`login` ASC LIMIT $begin ,30" ) ; else if ( $_GET [ 's' ] == "contant" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `cash` DESC,`login` ASC LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "online" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`showonline`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "admin" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "search" )
{
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']} ' ORDER BY `login` LIMIT $begin ,30" ) ; }
else
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`l evel`,`clan`,`leven` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin ,30" ) ;
$user = $_SESSION [ 'login' ] ;
{
// ????
$login = ( $info -> showonline == 0 && $data -> level == 0x80 && $_GET [ 's' ] == "online" ) ? "{$info->login} *" : $info -> login ;
// onthoud admins dikgedrukt en met *, als betreffende user dat is
$login = ( $info -> level & 0x80 ) ? "<b><font color=red>$login * </b>" : $login ;
$login = ( $info -> level == 5 ) ? "<b><font color=#Green>$login * </b>" : $login ;
$login = ( $info -> level == 100 ) ? "<b><font color=#000000>$login *</b>" : $login ; $leven = $info -> leven ;
$contant = $info -> cash + $info -> contant ;
$clan = $info -> clan ;
$clicks = $info -> clicks ;
// maak een array met typen
$type = Array ( "" , "Hippie" , "Skinhead" , "FBI Agent" ) ;
// onthoud betreffende type
$type = $type [ $info -> type ] ;
// rond berekening van power af op gehele waarde en onthoud deze van de betreffende typen
$power = round ( ( $info -> attack + $info -> defence ) / 2 + $info -> clicks * 5 ) ;
// money is bank+cash waarde van betreffende coureur
$money = $info -> cash + $info -> bank ;
if ( $power <= 100 ) {
$rank = "Zwerver" ;
} elseif ( $power > 100 AND $power <= 300 ) {
$rank = "Bedelaar" ;
} elseif ( $power > 300 AND $power <= 700 ) {
$rank = "Crimineel" ;
} elseif ( $power > 700 AND $power <= 1900 ) {
$rank = "Zakkenroller" ;
} elseif ( $power > 1300 AND $power <= 2800 ) {
$rank = "Tuig" ;
} elseif ( $power > 2000 AND $power <= 3900 ) {
$rank = "Geweldadig" ;
} elseif ( $power > 2800 AND $power <= 4750 ) {
$rank = "Autodief" ;
} elseif ( $power > 3700 AND $power <= 6700 ) {
$rank = "Drugsdealer" ;
} elseif ( $power > 4700 AND $power <= 7800 ) {
$rank = "Gangster" ;
} elseif ( $power > 5800 AND $power <= 9000 ) {
$rank = "Overvaller" ;
} elseif ( $power > 6000 AND $power <= 1500 ) {
$rank = "Bendeleider" ;
} elseif ( $power > 7300 AND $power <= 18200 ) {
$rank = "Huurmoordenaar" ;
} elseif ( $power > 25200 ) {
$rank = "God" ;
}
// toon een rij met de kolommen: nummer, loginnaam, type, money en power van de user met nummer $j
?>
<tr><td align="center" class=\"mainTxt\" width="20"><?= $j ; ?> </td>
<td class=\"mainTxt\"><a href="profile.php?x={$info->login}"><?= $login ; ?> </a></td>
<td align="center" class=\"mainTxt\" width="150"><?= $type ; ?> </td>
<td align="center" class=\"mainTxt\" width="150"><?= $leven ; ?> %</td>
<td align="center" class=\"mainTxt\" width="100"><?= $clan ; ?> </td>
<td align="center" class=\"mainTxt\" width="100"><?= $money ; ?> $</td>
<td align="center" class=\"mainTxt\" width="100"><?= $power ; ?> </td>
<?php
// DEBUG COMMENT: hier gaat SESSION de mist in
// DEBUG CODE:
echo "<td align=\" center\" class=\" mainTxt\" width=100>" . $_SESSION [ 'login' ] . "</td>" ;
// als type niet is: HaCkEr OF (type is HaCkEr EN
if ( ( $data -> type != 3 || ( $data -> type == 3 && $info -> type != 3 ) ) && round ( $data -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && round ( $info -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && ( $info -> clan != $data -> clan || $info -> clan == "" ) ) print " <td align=\" center\" class=\" mainTxt\" ><a href=\" attack.php?x={$info->login} \" >Attack</a></td></tr>\n \n " ; else
}
// als type niet is: HaCkEr OF (type is HaCkEr EN
if ( ( $data -> type != 3 || ( $data -> type == 3 && $info -> type != 3 ) ) && round ( $data -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && round ( $info -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && ( $info -> clan != $data -> clan || $info -> clan == "" ) ) print " <td align=\" center\" class=\" mainTxt\" ><a href=\" attack.php?x={$info->login} \" >Attack</a></td></tr>\n \n " ; else
if ( $_GET [ 's' ] == "online" )
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300" ) ;
else if ( $_GET [ 's' ] == "online" )
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=1" ) ;
else if ( $_GET [ 's' ] == "admin" )
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "search" )
{
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']} ' ORDER BY `login`" ) ;
}
else
$dbres = mysql_query ( "SELECT id FROM `[users]` WHERE `activated`=1" ) ; print "</table>\n \n <table width=100%>\n <tr><td class=\" mainTxt\" align=\" center\" >" ;
print "< 1 ></td></tr></table>\n " ;
else
{
if ( $begin / 30 == 0 )
else
print ( "<a href=\" list.php?s={$_GET['s']} &q={$_GET['q']} &p=\" " . ( $begin / 30 - 1 ) . "\" ><<</a> " ) ;
for ( $i = 0 ; $i < mysql_num_rows( $dbres ) / 30 ; $i ++ )
{
print ( "<a href=\" list.php?s={$_GET['s']} &q={$_GET['q']} &p=$i \" >" . ( $i + 1 ) . "</a> " ) ; }
else
print ( "<a href=\" list.php?s={$_GET['s']} &q={$_GET['q']} &p=" . ( $begin / 30 + 1 ) . "\" >>></a>" ) ; }
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300" ) ; $dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=0" ) ; $dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `level`=255" ) ;
/* ------------------------- */ ?>
</table>
<table width=100%>
<tr><td align="center"><a href="list.php?s=online"><b>
<?php print $online ; ?> leden online</b></a></td></tr>
<tr><td align="center"><a href="list.php?s=admin"><b>
<?php print $admins ; ?> beheerder(s) online</b></a></td></tr>
<tr><td align="center"><font color=darkblue><b>Admins worden aangegeven als:</b><font color=red><b>Loginnaam<img src="images/diamant.gif" width=10 height=10 border=0 alt="diamant"></b></font></td></tr>
<tr><td align="center"><font color=darkblue><b>Betaalde Accounts als:</b><font color=#4DFF00<b>Loginnaam<img src="images/ster2.gif" width=10 height=10 border=0 alt="/images/ster2.gif"></b></font></td></tr>
</table>
<?php
$login = $user ;
// DEBUG CODE:
// echo $_SESSION["login"];
?>
</body>
</html>
<span Style="display: none">
EDIT: Iemand een idee?
Is nogal dringend!
Ibrahim - 29/07/2005 22:47
PHP expert
hij heeft een config bestand ingevoegd dus mss zal het daar wel instaan haytjes
Gesponsorde links
Dit onderwerp is gesloten .