Hello, I'm trying to do dynamic pages and i got told some code, I put it in my website and now im getting errors, The webpage is ment to look like this http://www.homicidalservers.com/ that is what it looked like before i put the code in, but now it looks like this www.boast-host.co.uk/design/new/index.php somethign is seriously wrong, These are my files: INDEX.PHP: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Untitled Document</title> <link href="http://www.boast-host.co.uk/design/new/css/style.css" rel="stylesheet" type="text/css" /> <?php $date = date("d/m/y"); // check for _GET['page'] -> index.php?page= ... if (isset($_GET['page'])) { $page = trim($_GET['page']); // delete whitespace // check what is requested switch($page) { case 'home': // if index.php?page=home then include('./pages/home.php'); break; // jump out of switch() case 'servers': // if index.php?page=about then ... include('./pages/servers.php'); break; case 'buyadmin': include('./pages/buyadmin.php'); break; case 'maps': include('./pages/maps.php'); break; case 'pictures': include('./pages/pictures.php'); break; case 'donate': include('./pages/donate.php'); break; default: // if something like index.php?page=blabla then include('./pages/home.php'); break; } } // if nothing is set, default page else include('./pages/home.php'); ?> </head> <body> <div id="main"> <?php include('./includes/header.php'); include('./includes/bar.php'); include('./includes/side.php'); include($page); include('./includes/footer.php'); ?> </div> </body> </html> PHP: SIDE.PHP: <?php echo "<div id=\"side\"> <h3>Menu</h3> - <a href=\"index.php?page=home\">Home</a><br> - <a href=\"/forums/\">Forums</a><br> - <a href=\"index.php?page=servers\">Servers</a><br> - <a href=\"index.php?page=buyadmin\">Buy Admin</a><br> - <a href=\"index.php?page=maps\">Maps</a><br> - <a href=\"index.php?page=pictures\">Pictures</a><br> - <a href=\"index.php?page=donate\">Donate</a><br> </div>" ?> PHP: HOME.PHP(all content files are the same for testing so i will only show one) <?php echo" <div id=\"content\"> <h2>Home</h2> <p>Welcome to our website, Please look around and visit the forums.</p> </div>" ?> PHP: I am not going to include the style.css as it's to long, and i am almost positive that isnt the problem as i didnt change that. can anyone see the problem? Thanks
Just looking at your code.. You have That is not a good idea! http://www.boast-host.co.uk/design/new/?page=../../services.html
Why do you need to do it using ?page= ? Why not just use different pages - it's better for SEO and friendly links. If you really need to do it that way, I'll have a think about how best to approach it.