i wrote a script which enables me to link to other pages using the index.php page like this index.php?page=privacy. but there seems to be a problem. when i load this url, the privacy page does come up but after the page finishes loading, index.php also loads under it. this is the code for the script:
what can i do to stop this from happening? is it because i saved this script in an external file as nav.php and in the index.php page i wrote <?php include('nav.php')?> and then wrote the code for the page in html?
| Code: |
|
<?php switch($_GET['page']) { case 'forum': include('forum/index.php'); break; case 'ul': include('upload.php'); break; case 'dl': include('downloads.php'); break; case 'about': include('about.php'); break; case 'advertise': include('advertise.php'); break; case 'contact': include('contact.php'); break; case 'privacy': include('privacy.php'); break; case 'request': include('request.php'); break; case 'sitemap': include('sitemap.php'); break; default: include('index.php'); break; } ?> |
what can i do to stop this from happening? is it because i saved this script in an external file as nav.php and in the index.php page i wrote <?php include('nav.php')?> and then wrote the code for the page in html?
