MasterRenny Posted December 7, 2007 Share Posted December 7, 2007 Hello Ive been trying to debug my code, but i cant seem to see whats up with it! Heres My links <li><a HREF="?link=Home">Home</a> </li> <li><a HREF="?link=About">About</a></li> <li><a HREF="?link=Rules"> Rules</a></li> <li><a HREF="?link=News">News</a></li> <li><a HREF="?link=Downloads">Downloads</a></li> And heres my code for where i want it to show; <?PHP if($_GET['link'] == "Home"){ include("/news/show_news.php"); } elseif($_GET['link'] == "About"){ include("/about.html"); } elseif($_GET['link'] == "Rules"){ include("/rules.html"); } elseif($_GET['link'] == "News"){ include("/news/show_archives.php"); } elseif($_GET['link'] == "Downloads"){ include("/downloads.html"); } else{ include("/news/show_news.php"); } ?> any ideas? im really confuzed on why its not working becuase it use to work! Thanks, Renny Quote Link to comment Share on other sites More sharing options...
helraizer Posted December 7, 2007 Share Posted December 7, 2007 In what way is it not working? Do you get any errors or just a blank screen? Give us something to work with here Aswell, add this to your file. error_reporting(E_ALL); ini_set('display_errors', true); Sam Quote Link to comment Share on other sites More sharing options...
MasterRenny Posted December 7, 2007 Author Share Posted December 7, 2007 Oh yer sorry forgot when i load it all all i get is a black page, and when i click on a link the page dont show http://www.spartansguild.co.uk/ <<<<< see =[ the massive blank area to the left is where the text is ment to show up And ok ill try adding the code =] Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 7, 2007 Share Posted December 7, 2007 Your including your files wrong, remove backslashes "/filename.html" before the filenames. Quote Link to comment Share on other sites More sharing options...
MasterRenny Posted December 7, 2007 Author Share Posted December 7, 2007 Your including your files wrong, remove "/filename.html" after the filenames. Wait, sorry misread it ok ill try it Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 7, 2007 Share Posted December 7, 2007 Your including your files wrong, remove "/filename.html" after the filenames. sorry dont understand oO try this <?php if($_GET['link'] == "Home"){ include("news/show_news.php"); } elseif($_GET['link'] == "About"){ include("about.html"); } elseif($_GET['link'] == "Rules"){ include("rules.html"); } elseif($_GET['link'] == "News"){ include("newsshow_archives.php"); } elseif($_GET['link'] == "Downloads"){ include("downloads.html"); } else{ include("news/show_news.php"); } ?> Quote Link to comment Share on other sites More sharing options...
MasterRenny Posted December 7, 2007 Author Share Posted December 7, 2007 Your including your files wrong, remove "/filename.html" after the filenames. sorry dont understand oO try this <?php if($_GET['link'] == "Home"){ include("news/show_news.php"); } elseif($_GET['link'] == "About"){ include("about.html"); } elseif($_GET['link'] == "Rules"){ include("rules.html"); } elseif($_GET['link'] == "News"){ include("newsshow_archives.php"); } elseif($_GET['link'] == "Downloads"){ include("downloads.html"); } else{ include("news/show_news.php"); } ?> Nope still dont work Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 7, 2007 Share Posted December 7, 2007 Can you post the entire script please? Or is this it? Also, you might want to try <?php error_reporting(E_ALL); ini_set('display_errors', true); ?> Quote Link to comment Share on other sites More sharing options...
MasterRenny Posted December 7, 2007 Author Share Posted December 7, 2007 Yay! it works! thank you so much =D!!! Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 7, 2007 Share Posted December 7, 2007 Yay! it works! thank you so much =D!!! Ya np, but did you say it didnt work? Quote Link to comment Share on other sites More sharing options...
helraizer Posted December 7, 2007 Share Posted December 7, 2007 Can you post the entire script please? Or is this it? Also, you might want to try <?php error_reporting(E_ALL); ini_set('display_errors', true); ?> Oh, he listens to you then. *sulks* Quote Link to comment Share on other sites More sharing options...
MasterRenny Posted December 7, 2007 Author Share Posted December 7, 2007 Can you post the entire script please? Or is this it? Also, you might want to try <?php error_reporting(E_ALL); ini_set('display_errors', true); ?> Oh, he listens to you then. *sulks* =] But yes it didnt work, and since i put that code in my page it works fine now! thanks again Quote Link to comment Share on other sites More sharing options...
helraizer Posted December 7, 2007 Share Posted December 7, 2007 Can you post the entire script please? Or is this it? Also, you might want to try <?php error_reporting(E_ALL); ini_set('display_errors', true); ?> Oh, he listens to you then. *sulks* =] But yes it didnt work, and since i put that code in my page it works fine now! thanks again I beg to differ. It works now in principle but in reality: Warning: main(about.html) [function.main]: failed to open stream: No such file or directory in /home/eternalg/public_html/index.php on line 53 Warning: main(about.html) [function.main]: failed to open stream: No such file or directory in /home/eternalg/public_html/index.php on line 53 Warning: main() [function.include]: Failed opening 'about.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eternalg/public_html/index.php on line 53 -and- Warning: main(newsshow_archives.php) [function.main]: failed to open stream: No such file or directory in /home/eternalg/public_html/index.php on line 55 Warning: main(newsshow_archives.php) [function.main]: failed to open stream: No such file or directory in /home/eternalg/public_html/index.php on line 55 Warning: main() [function.include]: Failed opening 'newsshow_archives.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eternalg/public_html/index.php on line 55 -and- Warning: main(downloads.html) [function.main]: failed to open stream: No such file or directory in /home/eternalg/public_html/index.php on line 56 Warning: main(downloads.html) [function.main]: failed to open stream: No such file or directory in /home/eternalg/public_html/index.php on line 56 Warning: main() [function.include]: Failed opening 'downloads.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eternalg/public_html/index.php on line 56 Sam Quote Link to comment Share on other sites More sharing options...
MasterRenny Posted December 7, 2007 Author Share Posted December 7, 2007 Yer thats becuase ive not uploaded them 3 files yet =] ill upload them, give me a sec and then you'll see it all works nicely ^.^ Quote Link to comment Share on other sites More sharing options...
helraizer Posted December 7, 2007 Share Posted December 7, 2007 Yer thats becuase ive not uploaded them 3 files yet =] ill upload them, give me a sec and then you'll see it all works nicely ^.^ That could indeed explain it. Glad you got it working. Sam Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 7, 2007 Share Posted December 7, 2007 Yer thats becuase ive not uploaded them 3 files yet =] ill upload them, give me a sec and then you'll see it all works nicely ^.^ That could indeed explain it. Glad you got it working. Sam Despite the fact he didn't upload the files, he didn't include them the right way either. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.