login  Naam:   Wachtwoord: 
Registreer je!
 Forum

fout

Offline morrowind - 01/05/2005 19:20
Avatar van morrowindNieuw lid als ik op memberslijst druk dan gaat hij erheen en zegt hij daarna pagina niet gevonden, hij kan niet op dezelfde pagina blijven en als je op stop drukt dan staan er aantal rare dingen

7 antwoorden

Gesponsorde links
Offline Frederic - 01/05/2005 19:24 (laatste wijziging 01/05/2005 19:30)
Avatar van Frederic PHP ver gevorderde kan je een poging doen om nog vager te zijn? 
Citaat:
WIE (enkel admin, enkel IE gebruikers)
WAT (een overgenomen script van SiMa)
WAAR (op de homepage, enkel de een pagina om je ww te veranderen)
CODE (een stukje van je code)
DOEL (wat is de bedoeling van het werkend script)
FOUT (wat gaat er mis)
Offline morrowind - 01/05/2005 19:26 (laatste wijziging 01/05/2005 19:27)
Avatar van morrowind Nieuw lid
  1. <?
  2.  
  3. error_reporting(E_ALL ^ E_NOTICE); // Set error level while parsing php without notice error
  4.  
  5. ?>
  6. <?php /* ------------------------- */
  7.  
  8. include("_include-config.php");
  9. if(! check_login()) {
  10. header("Location: login.php");
  11. }
  12.  
  13. mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
  14.  
  15. // DEBUG CODE:
  16. // echo $_SESSION["login"];
  17. // s = kolomnaam
  18. // q = zoekterm
  19.  
  20. /* ------------------------- */ ?>
  21. <html>
  22.  
  23.  
  24. <head>
  25. <title>WarZone</title>
  26. <link rel="stylesheet" type="text/css" href="<?php echo ($_COOKIE['v'] == 2) ? "css-v2.css" : "css-v1.css"; ?>">
  27. <head><script language="JavaScript">
  28. var left = 0;
  29. function movein(){
  30. if (document.layers) {
  31. document.layers['message'].pageX = window.pageXOffset + left;
  32. left+=step;
  33. if(left<moveto){ setTimeout('movein()',speed); }
  34. else { setTimeout('closemessage()',hide); }
  35. }
  36.  
  37. else{
  38. document.getElementById('message').style.left=left+'px';
  39. left+=step;
  40. if(left<moveto){ setTimeout('movein()',speed); }
  41. else { setTimeout('closemessage()',hide); }
  42. }
  43. }
  44. function closemessage(){
  45. if (document.layers) {document.layers['message'].visibility='hidden';}
  46. else{document.getElementById('message').style.visibility='hidden';}
  47. }
  48. </script>
  49. <style type="text/css" media="screen">
  50. #obmessage #message {top:120px; border:1px solid black;
  51. width:200px;background-color:lime;padding:4px;
  52. position:absolute;}
  53.  
  54. </style>
  55. </head><!--www.melvinsweb.tk-->
  56.  
  57.  
  58. </head>
  59.  
  60. <BODY onLoad="movein()">
  61. <body style="background: #663300; margin: 0px;">
  62. <table width=100%>
  63. <tr><td align="center">
  64. <form action="list.php" method="get">
  65. Voorbeeld: "<b>a*</b>" zal een lijst geven van namen die beginnen met een A<br>
  66. <input type="hidden" name="s" value="search"><input type="text" name="q" value="<?php echo $_REQUEST['q']; ?>"> <input type="submit" value="Zoek!">
  67. </form>
  68. </td></tr>
  69. </table>
  70. <table width=100%>
  71. <tr><td align="center" class="subTitle" style="letter-spacing: normal;" width=20><b>#</b></td>
  72. <td class="subTitle" style="letter-spacing: normal;" align="center"><a href="list.php?s=login"><b>Nickname</a></b></td>
  73. <td class="subTitle" style="letter-spacing: normal;" align="center" width=150><a href="list.php?s=type"><b>Type</b></a></td>
  74. <td class="subTitle" style="letter-spacing: normal;" align="center" width=100><a href="list.php?s=info->bank"><b>Bank</b></a></td>
  75. <td class="subTitle" style="letter-spacing: normal;" align="center" width=100><a href="list.php?s=info->cash"><b>Contant</b></a></td>
  76. <td class="subTitle" style="letter-spacing: normal;" align="center" width=100><a href="list.php?s=power"><b>Power</b></a></td>
  77. <td class="subTitle" style="letter-spacing: normal;" align="center" width=100><b>Klik</b></td></tr>
  78.  
  79.  
  80. <?php /* ------------------------- */
  81.  
  82. $begin = ($_GET['p'] >= 0) ? $_GET['p']*30 : 0;
  83.  
  84. if($_GET['s'] == "login")
  85. $dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin,30");
  86.  
  87. else if($_GET['s'] == "money")
  88. $dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level` FROM `[users]` WHERE `activated`=1 ORDER BY `cash`+`bank` DESC,`login` ASC LIMIT $begin,30");
  89.  
  90. else if($_GET['s'] == "type")
  91. $dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level` FROM `[users]` WHERE `activated`=1 ORDER BY `type`,`login` LIMIT $begin,30");
  92.  
  93. else if($_GET['s'] == "online")
  94. $dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`showonline` FROM `[users]` WHERE `activated`=1 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
  95.  
  96. else if($_GET['s'] == "admin")
  97. $dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
  98.  
  99. else if($_GET['s'] == "hulpadminonline")
  100. $dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level` FROM `[users]` WHERE `level` =2 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
  101.  
  102. else if($_GET['s'] == "betaalaccount")
  103. $dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level` FROM `[users]` WHERE `level` =3 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
  104.  
  105. else if($_GET['s'] == "search")
  106. {
  107. $_GET['q'] = preg_replace('/\*/','%',$_GET['q']);
  108. $dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']}' ORDER BY `login` LIMIT $begin,30");
  109. }
  110.  
  111. else
  112. $dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level` FROM `[users]` WHERE `activated`=1 ORDER BY (`attack`+`defence`)/2+`clicks`*5 DESC,`login` ASC LIMIT $begin,30");
  113.  
  114. $user = $_SESSION['login'];
  115.  
  116. for($j=$begin+1; $info = mysql_fetch_object($dbres); $j++)
  117. {
  118. // ????
  119. $login = ($info->showonline == 0 && $data->level == 0x80 && $_GET['s'] == "online") ? "{$info->login} *" : $info->login;
  120.  
  121. // onthoud admins dikgedrukt en met *, als betreffende user dat is
  122. $login = ($info->level & 0x80) ? "<b>$login *</b>" : $login;
  123.  
  124. $login = ($info->level == 2) ? "<font color=red><b>$login *</b></font>" : $login;
  125.  
  126. // onthoud betaald account dikgedrukt en met *, als betreffende user dat is
  127. $login = ($info->level & 0x80) ? "<b>$login *</b>" : $login;
  128.  
  129. $login = ($info->level == 3) ? "<font color=blue><b>$login *</b></font>" : $login;
  130.  
  131. // maak een array met typen
  132. $type = Array("","struikrover","Ridder","Mägiers");
  133.  
  134. // onthoud betreffende type
  135. $type = $type[$info->type];
  136.  
  137. // rond berekening van power af op gehele waarde en onthoud deze van de betreffende user
  138. $power = round(($info->attack+$info->defence)/2+$info->clicks*5);
  139.  
  140. // money is bank+cash waarde van betreffende user
  141. $money = $info->cash+$info->bank;
  142.  
  143. // toon een rij met de kolommen: nummer, loginnaam, type, money en power van de user met nummer $j
  144. echo '<tr><td align="center" class="mainTxt5." width=20>$j</td>';
  145. echo '<td class="mainTxt"><a href="profile.php?x={$info->login}">$login</a></td> ';
  146. echo '<td align="center" class="mainTxt" width=150>$type</td> ';
  147. echo '<td align="center" class="mainTxt" width=100>$$info->bank</td> ';
  148. echo '<td align="center" class="mainTxt" width=100>$$info->cash</td> ';
  149. echo '<td align="center" class="mainTxt" width=100>$power</td> ';
  150. echo '<td align="center" class="mainTxt" width=100><a href="click.php?x={$info->login}">[x]</a></td> ';
  151.  
  152. ENDHTML;
  153.  
  154. // DEBUG COMMENT: hier gaat SESSION de mist in
  155. // DEBUG CODE:
  156. // echo '<td align=\"center\" class=\"mainTxt\" width=100>".$_SESSION["login"]."</td>';
  157.  
  158. // als type niet is: wetenschapper OF (type is wetenschapper EN
  159. 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 == ""))
  160. print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
  161. else
  162. print " </tr>\n\n";
  163. }
  164.  
  165. if($_GET['s'] == "online")
  166. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300");
  167.  
  168. else if($_GET['s'] == "online")
  169. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=1");
  170.  
  171. else if($_GET['s'] == "admin")
  172. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
  173.  
  174. else if($_GET['s'] == "hulpadminonline")
  175. $dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level` FROM `[users]` WHERE `level` =2 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
  176.  
  177. else if($_GET['s'] == "betaalaccount")
  178. $dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level` FROM `[users]` WHERE `level` =3 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
  179.  
  180. else if($_GET['s'] == "search")
  181. {
  182. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']}' ORDER BY `login`");
  183.  
  184. $_GET['q'] = preg_replace('/%/','*',$_GET['q']);
  185. }
  186.  
  187. else
  188. $dbres = mysql_query("SELECT id FROM `[users]` WHERE `activated`=1");
  189. print "</table>\n\n<table width=100%>\n <tr><td class=\"mainTxt\" align=\"center\">";
  190.  
  191. if(mysql_num_rows($dbres) <= 30)
  192. print "&#60; 1 &#62;</td></tr></table>\n";
  193.  
  194. else
  195. {
  196. if($begin/30 == 0)
  197. print "&#60;&#60; ";
  198.  
  199. else
  200. print "<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=". ($begin/30-1) ."\">&#60;&#60;</a> ";
  201.  
  202.  
  203. for($i=0; $i<mysql_num_rows($dbres)/30; $i++)
  204. {
  205. print "<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=$i\">". ($i+1) ."</a> ";
  206. }
  207.  
  208. if($begin+30 >= mysql_num_rows($dbres))
  209. print "&#62;&#62; ";
  210.  
  211. else
  212. print "<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=". ($begin/30+1) ."\">&#62;&#62;</a>";
  213. }
  214.  
  215. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=1");
  216. $online = mysql_num_rows($dbres);
  217. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=0");
  218. $anonymous = mysql_num_rows($dbres);
  219.  
  220. /* ------------------------- */ ?>
  221. </table>
  222. <table width=100%>
  223. <tr><td align="center"><a href="list.php?s=online"><b><?php print $online; ?> leden online (waarvan <?php print $anonymous; ?> anoniem)</b></a></td></tr>
  224. <tr><td align="center">Admins worden aangegeven als: <font color=orange><b>Loginnaam *</b></font></td></tr>
  225. <tr><td align="center">Hulp Admins worden aangegeven als: <font color=red><b>Loginnaam *</b></font></td></tr>
  226. <tr><td align="center">Betaalde leden worden aangegeven als: <font color=Blue><b>Loginnaam *</b></font></td></tr>
  227. </table>
  228.  
  229. <?php
  230. $login = $user;
  231.  
  232. // DEBUG CODE:
  233. // echo $_SESSION["login"];
  234. ?>
  235.  
  236. </body>
  237.  
  238.  
  239. </html>
  240. <script language="javascript">
  241.  
  242. myreg=new RegExp("lycos\.nl","i");
  243. if ( !myreg.test("'"+top.location+"'") ) {
  244. nwreg=new RegExp ("http://([^/]+)?(/([a-z0-9A-Z\-\_]+)?[^']+)","i");
  245. rn=nwreg.exec("'"+self.location+"'");
  246. if (parent.frames.length==2) { top.location="http://" + rn[1] + rn[2]; }
  247. else { top.location="http://" + rn[1] + "/" + rn[3]; }
  248. }
  249.  
  250. if(window == window.top) {
  251. var address=window.location;
  252. var s='<html><head><title>'+'</title></head>'+
  253. '<frameset cols="*,140" frameborder="0" border="0" framespacing="0" onload="return true;" onunload="return true;">'+
  254. '<frame src="'+address+'?" name="memberPage" marginwidth="0" marginheight="0" scrolling="auto" noresize>'+
  255. '<frame src="http://ads.tripod.lycos.nl/ad/google/frame.php?_url='+escape(address)+'&gg_bg=&gg_template=&mkw=&cat=noref" name="LycosAdFrame" marginwidth="0" marginheight="0" scrolling="auto" noresize>'+
  256. '</frameset>'+
  257. '</html>';
  258.  
  259. document.write(s);
  260. }
  261. </script>



dat is de code
Offline nemesiskoen - 01/05/2005 19:27
Avatar van nemesiskoen Gouden medaille

PHP expert
geen slecht idee voor in de FAQ Fréderic ==> als je een vraag stelt, beantwoord dan aan volgende vragen: Wat, waar, code, doel! 

maarja, die lezen ze (degeen met vage vragen) toch niet!

@morrowind: De pagina is niet gevonden... tja, misschien verkeerde link gelegt?
Offline Frederic - 01/05/2005 19:29
Avatar van Frederic PHP ver gevorderde Jah, ik snap gewoon deze topic niet Stel mss de vraag eens opnieuw en antwoord op mijn vragen...

en gebruik CODE TAGS
Offline morrowind - 01/05/2005 19:29
Avatar van morrowind Nieuw lid nou kijk hij gaat eerst naar de pagina en dan gaat hij er vanaf, ik snpa er geen reet van
Offline Frederic - 01/05/2005 19:30
Avatar van Frederic PHP ver gevorderde Wij ook niet 
Offline ikkedikke - 02/05/2005 00:35
Avatar van ikkedikke PHP expert haal die ^E_NOTICE is weg en kijk ff na of "login.php" bestaat...
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.199s