salvador2001 Posted April 17, 2006 Share Posted April 17, 2006 Hi all,I have got a mayor problem. I have poor knowledgde of PHP and i cant solve this one.After a few days i am getting realy frustrated about this...I have this script and its working fine basicly. I want to add a directory to the script, in this directory are a few pages i want to load.All i get is an errorpage or error messages....I have to finish this very soon so i hope that somebody can help me out here.Would somebody please, please, please adjust the script for me ????I would be very thankfull !![code]<?php // loading permitted pagesif(isset($_GET['load'])) { switch($_GET['load']) { case 'news': case 'about': case 'members': case 'organisation': case 'members/page1': case 'members/page2': $load = $_GET['load']; break; default: $load = 'error404'; } } else { $load = 'welcome'; // -- if $_GET['load'] is not defined} // loading from dir ** but this is not workingelseif($load == "members") { include "members/page1.php"; } elseif($load == "members") { include "members/page2.php"; } // loading errorpageelse { include("http://www.xxxxxx/error404.php"); } ?> [/code] Link to comment https://forums.phpfreaks.com/topic/7606-calling-a-page-from-a-directory/ Share on other sites More sharing options...
Darkness Soul Posted April 17, 2006 Share Posted April 17, 2006 You will get a parse error:[code]<?php } else { $load = 'welcome'; // -- if $_GET['load'] is not defined} // loading from dir ** but this is not workingelseif($load == "members") { include "members/page1.php"; }?> [/code]if {}else {}elseif {} (?)Why you're testin two times the same thing??In your switch, you have members, m/p1, m/p2.. in your code.. if members.. p1 e p2..Exemple what you want about that point of code.. =)D.Soul Link to comment https://forums.phpfreaks.com/topic/7606-calling-a-page-from-a-directory/#findComment-27742 Share on other sites More sharing options...
salvador2001 Posted April 17, 2006 Author Share Posted April 17, 2006 my purpose is that i can load pages from the members directory. like page1 and page2so if i call it from the menu with [a href=\"http://www.mydomain.com/index.php?load=page1.php\" target=\"_blank\"]http://www.mydomain.com/index.php?load=page1.php[/a] it will appear.Now all i get is an error page 404.I do have great difficutltys learning the code. Link to comment https://forums.phpfreaks.com/topic/7606-calling-a-page-from-a-directory/#findComment-27848 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.