login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Menu beperkt toegankelijk

Offline micasa001 - 15/08/2007 20:55
Avatar van micasa001PHP interesse Momenteel heb ik het volgende staan in mijn index.

  1. print <<<ENDHTML
  2. </table></td></tr>
  3.   </table>
  4.  
  5.  
  6.  
  7. <br>
  8.  
  9.  
  10.   <table class="menu" width=100% cellpadding=0 cellspacing=0 align=center>
  11.   <tr><td><table width=100% cellpadding=0 cellspacing=0>
  12. <tr><td width=5 class="menuTitle">&nbsp;<a onClick="showMenu('politiek')">#</a>&nbsp;</td>
  13. <td class="menuTitle"><b>Politieke Partij</b></td></tr>
  14. </table>
  15. <table width=100% cellpadding=0 cellspacing=0 ID="politiek" style="position: absolute; left: -100; top: -100; visibility: hidden;">
  16.   <tr><td class="menuLink">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href="../clanlist.php" class="menu">Verkiezing Lijst</a></td></tr>
  17. ENDHTML;
  18. if($data->clanlevel == 0) {
  19. print " <tr><td class=\"menuLink\">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href=\"../clan.php?p=join\" class=\"menu\">Aanmelden</a></td></tr>\n";
  20. if($data->clanlevel == 0)
  21. print " <tr><td class=\"menuLink\">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href=\"../clan.php?p=new\" class=\"menu\">Nieuwe Partij</a></td></tr>\n";
  22. }
  23. else {
  24. print " <tr><td class=\"menuLink\">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href=\"../clan.php?x={$data->clan}\" class=\"menu\">Profiel Overzicht</a></td></tr>\n";
  25.  
  26. print " <tr><td class=\"menuLink\">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href=\"../clan-donate.php\" class=\"menu\">Doneer Geld</a></td></tr>\n";
  27. print " <tr><td class=\"menuLink\">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href=\"../clanban.php\" class=\"menu\">Verban Leden</a></td></tr>\n";
  28. print " <tr><td class=\"menuLink\">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href=\"../clanlog.php\" class=\"menu\">Partij Logs</a></td></tr>\n";
  29. if($data->clanlevel >= 8 || $data->clanlevel == 6) {
  30. print " <tr><td class=\"menuLink\">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href=\"../clanbank.php\" class=\"menu\">Bank Account</a></td></tr>\n";
  31. print " <tr><td class=\"menuLink\">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href=\"../clanshop.php\" class=\"menu\">Investeringen</a></td></tr>\n";
  32. }
  33. if($data->clanlevel >= 8 || $data->clanlevel == 2)
  34. print " <tr><td class=\"menuLink\">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href=\"../clanhq.php?p=recruits\" class=\"menu\">Aanmeldingen</a></td></tr>\n";
  35. if($data->clanlevel >= 8) {
  36. print " <tr><td class=\"menuLink\">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href=\"../bescherming.php?p=bes\" class=\"menu\">Bescherming</a></td></tr>\n";
  37. print " <tr><td class=\"menuLink\">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href=\"../clanhq.php?p=members\" class=\"menu\">Partij Leden</a></td></tr>\n";
  38. print " <tr><td class=\"menuLink\">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href=\"../clanhq.php?p=info\" class=\"menu\">Algemene Informatie</a></td></tr>\n";
  39.  
  40. }
  41. if($data->clanlevel > 0) {
  42. if($data->clanlevel < 9)
  43. print " <tr><td class=\"menuLink\">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href=\"../clan.php?p=quit\" class=\"menu\">Verlaat Partij</a></td></tr>\n";
  44. else
  45. print " <tr><td class=\"menuLink\">&nbsp;<img src='images/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href=\"../clan.php?p=delete\" class=\"menu\">Verwijder Partij</a></td></tr>\n";
  46. }
  47. }
  48. print <<<ENDHTML
  49. </table></td></tr>
  50. </table>


Graag zou ik dit deel alleen willen weergeven wanneer er in de database in de tabel gebruiker - vip op 1 staat. Maar hoe doe ik dit?

Normaal zet ik iets dergelijks als:

  1. if($data->vip == 1 || $data->login == $admin2) {


Maar op deze manier werkt het niet.

Wie kan mij aangegeven hoe ik dit toch voor elkaar krijg.

5 antwoorden

Gesponsorde links
Offline Wim - 15/08/2007 23:17
Avatar van Wim Crew algemeen
  1. $query = mysql_query("SELECT id FROM members WHERE vip='1' AND username='".mysql_real_escape_string($gebruikersnaam)."' LIMIT 1");
  2. if(mysql_num_rows($query) > 0))
  3. {
  4. //hier je menu
  5. }
Offline micasa001 - 16/08/2007 11:36
Avatar van micasa001 PHP interesse Ik heb het geprobeerd:

  1. <br>
  2. $query = mysql_query("SELECT id FROM members WHERE vip='1' AND username='".mysql_real_escape_string($gebruikersnaam)."' LIMIT 1");
  3. if(mysql_num_rows($query) > 0))
  4. {
  5. <table class="menu" width=100% cellpadding=0 cellspacing=0 align=center>
  6. <tr><td><table width=100% cellpadding=0 cellspacing=0>
  7. <tr><td width=5 class="menuTitle">&nbsp;<a onClick="showMenu('legaal')">#</a>&nbsp;</td>
  8. <td class="menuTitle"><b>Legaal Cirquit</b></td></tr>
  9. </table>
  10. <table width=100% cellpadding=0 cellspacing=0 ID="legaal">
  11.  
  12. <tr><td class="menuLink">&nbsp;<img src='layout001/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href="../legaal-woning.php" class="menu">Woning</a></td></tr>
  13. <tr><td class="menuLink">&nbsp;<img src='layout001/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href="../werken.php" class="menu">Werken</a></td></tr>
  14. <tr><td class="menuLink">&nbsp;<img src='layout001/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href="../rankmisdaad.php" class="menu">Loopbaan</a></td></tr>
  15. <tr><td class="menuLink">&nbsp;<img src='layout001/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href="../training2.php" class="menu">Scholing</a></td></tr>
  16. <tr><td class="menuLink">&nbsp;<img src='layout001/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href="../legaal-debat.php" class="menu">Debat Voeren</a></td></tr>
  17. <tr><td class="menuLink">&nbsp;<img src='layout001/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href="../legaal-dealer.php" class="menu">Handelen</a></td></tr>
  18. <tr><td class="menuLink">&nbsp;<img src='layout001/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a href="../legaal-makelaar.php" class="menu">De Makelaar</a></td></tr>
  19. <tr><td class="menuLink">&nbsp;<img src='layout001/item.gif' align='absmiddle' border='0' alt='' style='border: 1px solid black;'>&nbsp;<a style="cursor: help;" href="../legaal-winkelstraat.php" class="menu">Winkelstraat</a></td></tr>
  20. </table></td></tr>
  21. </table>
  22. <br>
  23. }


Echter lukt het nog steeds niet. Als ik alles heb geupload dan staat er op de pagina nog steeds het menu met het enige verschil dat dit

  1. $query = mysql_query("SELECT id FROM members WHERE vip='1' AND username='".mysql_real_escape_string($gebruikersnaam)."' LIMIT 1");
  2. if(mysql_num_rows($query) > 0))
  3. {


Boven het menu zichbaar is als tekst.
Offline Clemens32 - 16/08/2007 11:39
Avatar van Clemens32 PHP interesse zet er eens <?php ?> omheen ;)
Offline Simax - 16/08/2007 11:54 (laatste wijziging 16/08/2007 11:54)
Avatar van Simax Onbekend En maak een menu zonder tabellen 
Offline Wim - 16/08/2007 13:23
Avatar van Wim Crew algemeen heb je alles correct ingevuld/aangepast
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.348s