login  Naam:   Wachtwoord: 
Registreer je!
 Forum

?pagina=... script help nodig

Offline Ultimatum - 17/08/2005 02:17 (laatste wijziging 17/08/2005 02:20)
Avatar van UltimatumPHP expert ik heb nu eindelijk ook die navigatie in php, maar nu wil ik dus een een map oproepen, alleen hoe doe ik dit, de link is:
  1. en.php?page=guestbook/index

(is idd anders dan bij onderwerp staat, maar dat is algemeen is wat beter te begrijpe;-) )
volgens mij heb ik het script van sm.be vandaan maar weet nie meer cker, drom plaats ik hier ff het script
en als ik nou op de link druk dan laat hij mijn home pagina zien home-en.htm in mijn geval

  1. //dit staat waar ik het wil laten zien ;)
  2. <?php
  3. switch($page)
  4. { default: include('home-en.htm');
  5. break; case "about": include('about-en.htm');
  6. break; case "dutch": include('dutch-en.htm');
  7. break; case "english": include('en-en.htm');
  8. break; case "paperback": include('paperback-en.htm');
  9. break; case "other": include('other-en.htm');
  10. break; case "pictures": include('pic-en.htm');
  11. break; case "forum": include('forum');
  12. break; case "guestbook": include('guestbook/index.php');
  13. break; case "sale": include('webshop/index.php');
  14. break; case "links": include('links.htm');
  15. break; case "contact": include('contact.php');
  16. }
  17. ?>


  1. //dit is me navigatie, beetje lang maar komt omdat ik met rollovers werk ;)
  2. <a href="en.php?page=home" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Home','','images/home_rollover.gif',1)"><img src="images/home.gif" name="Home" width="175" height="25" border="0"></a><br>
  3. <a href="en.php?page=about" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('about','','images/about_rollover.gif',1)"><img src="images/about.gif" name="about" width="175" height="25" border="0"></a><br>
  4. <a href="en.php?page=dutch" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('dutch','','images/dutch_rollover.gif',1)"><img src="images/dutch.gif" name="dutch" width="175" height="25" border="0"></a><br>
  5. <a href="en.php?page=english" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('english','','images/english_rollover.gif',1)"><img src="images/english.gif" name="english" width="175" height="25" border="0"></a><br>
  6. <a href="en.php?page=paperback" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('paperback','','images/paperback_rollover.gif',1)"><img src="images/paperback.gif" name="paperback" width="175" height="25" border="0"></a><br>
  7. <a href="en.php?page=other" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('other','','images/other_rollover.gif',1)"><img src="images/other.gif" name="other" width="175" height="25" border="0"></a><br>
  8. <a href="en.php?page=pic" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('pictures','','images/pictures_rollover.gif',1)"><img src="images/pictures.gif" name="pictures" width="175" height="25" border="0"></a><br>
  9. >> <a href="en.php?page=forum" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('forum','','images/forum_rollover.gif',1)"><img src="images/forum.gif" name="forum" width="175" height="25" border="0"></a><br>
  10. >> <a href="en.php?page=guestbook/index" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('gb','','images/gb_rollover.gif',1)"><img src="images/gb.gif" name="gb" width="175" height="25" border="0"></a><br>
  11. >> <a href="en.php?page=webshop/index" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Sale','','images/sale_rollover.gif',1)"><img src="images/sale.gif" name="Sale" width="175" height="25" border="0"></a><br>
  12. <a href="en.php?page=links" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('links','','images/links_rollover.gif',1)"><img src="images/links.gif" name="links" width="175" height="25" border="0"></a><br>
  13. <a href="en.php?page=contact" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image15','','images/contact_rollover.gif',1)"><img src="images/contact.gif" name="Image15" width="175" height="25" border="0"></a><br>
  14. <a href="http://www.cusslersociety.com/" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image16','','images/member_rollover.gif',1)"><img src="images/member.gif" name="Image16" width="175" height="63" border="0"></a><br>


ook weet ik dat dit script zeer onveilig is, maar het werkt bij mij, behalve de mappen dan
de desbetreffende regels in me navigatie zijn aangegeven met >> terverduideling 

ik hoop dat mijn vraag duidelijk is en dat jullie mij verder kunnen helpen

ik plaats hier ook de site ter verduideling en niet ter reclame , admins haal maar weg als jullie het nodig vinde 
<a href="http://cussler.cu.funpic.org/en.php>de link naar de site</a>

2 antwoorden

Gesponsorde links
Offline cracker - 17/08/2005 03:05 (laatste wijziging 17/08/2005 03:09)
Avatar van cracker Onbekend
  1. >> <a href="en.php?page=forum" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('forum','','images/forum_rollover.gif',1)"><img src="images/forum.gif" name="forum" width="175" height="25" border="0"></a><br>
  2. >> <a href="en.php?page=guestbook/index" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('gb','','images/gb_rollover.gif',1)"><img src="images/gb.gif" name="gb" width="175" height="25" border="0"></a><br>
  3. >> <a href="en.php?page=webshop/index" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Sale','','images/sale_rollover.gif',1)"><img src="images/sale.gif" name="Sale" width="175" height="25" border="0"></a><br>

Dat zijn algemene foutjes.
In je switch-functie zitten woorden als waarden van die cases.
Dus als jij en.php?page=guestbook/index doet, dan wordt die variabele dus ingesteld op "guestbook/index".
dat terwijl het gewoon "guestbook" moet zijn. (kijk naar uw script !)
idem voor die webshop-URI.

fout 2:
  1. break; case "forum": include('forum');

forum.php ? forum.htm ? forum.asp ?

Fout 3:
  1. break; case "een_variabele": include('een_pagina.php');

break komt NA een case

Note: dubbele quotes !
Offline Joel - 17/08/2005 03:39
Avatar van Joel Eigenaar Als je met Cracker zijn informatie niet toekomt, maak er dit van:

  1. //dit staat waar ik het wil laten zien ;)
  2. <?php
  3. switch ($_GET['page']) {
  4. case "about": include('about-en.htm'); break;
  5. case "dutch": include('dutch-en.htm'); break;
  6. case "english": include('en-en.htm'); break;
  7. case "paperback": include('paperback-en.htm'); break;
  8. case "other": include('other-en.htm'); break;
  9. case "pictures": include('pic-en.htm'); break;
  10. case "forum": include('forum.php'); break;
  11. case "guestbook/index": include('guestbook/index.php'); break;
  12. case "webshop/index": include('webshop/index.php'); break;
  13. case "links": include('links.htm'); break;
  14. case "contact": include('contact.php'); break;
  15.  
  16. default: include('home-en.htm');
  17. }
  18. ?>


Pas anders dit toe:
http://www.site...amp;id=225
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.237s