ev5unleash Posted June 29, 2008 Share Posted June 29, 2008 Alright, I already have gotten a good Php include script going <?php switch(strtolower($_GET['id'])) { case "58fhckjhdifehskdjh": include("homepage/news.php"); break; case "ud89fhes9ch02hfdek": include("othersites/CC/index.html"); break; case "49fjdkfodijfldkji": include("contact.html"); break; case "dfjke920doid9vj3d": include("smartboardsolution.html"); break; default: include("home.php"); break; }?> Don't ask why all the cases are the way that they are. Anyway, I want to have the same script as before but I want it so that it will include the informative text and information from the page as if it were (index.php?id=49fjdkfodijfldkji (the contact page)) So that the home.php is basically acting as a template and that one empty part of the page will be changed with what ever page is loaded (empty table page). A page with details of what I want to do http://www1.ev5unleash.com:1212/example.php Quote Link to comment https://forums.phpfreaks.com/topic/112441-solved-php-include-complex/ Share on other sites More sharing options...
br0ken Posted June 29, 2008 Share Posted June 29, 2008 Where you have written 'I want this part to be filled in with text from another page depending on what id is entered in (ex. index.php?id=contact). So that the contact information will be shown here.' you would simply put in another switch statement based on the id parameter and then include different files like you have in your switch statement above. I'm not sure if this is what you mean because it seems like to easy of a solution but let me know. Quote Link to comment https://forums.phpfreaks.com/topic/112441-solved-php-include-complex/#findComment-577263 Share on other sites More sharing options...
ev5unleash Posted June 29, 2008 Author Share Posted June 29, 2008 I'm having trouble understanding but all in very basic terms all I want is if you put ?id=contact in the address bar it will show the contact information with the home.php as a template. So I don't have to update every page I create. Quote Link to comment https://forums.phpfreaks.com/topic/112441-solved-php-include-complex/#findComment-577266 Share on other sites More sharing options...
jelly Posted June 29, 2008 Share Posted June 29, 2008 <?php include('./top.html'); // header switch(strtolower($_GET['id'])) // 'content' { case "58fhckjhdifehskdjh": include("homepage/news.php"); break; case "ud89fhes9ch02hfdek": include("othersites/CC/index.html"); break; case "49fjdkfodijfldkji": include("contact.html"); break; case "dfjke920doid9vj3d": include("smartboardsolution.html"); break; default: include("page.php"); break; } include('./bottom.html'); // footer ?> Quote Link to comment https://forums.phpfreaks.com/topic/112441-solved-php-include-complex/#findComment-577267 Share on other sites More sharing options...
ev5unleash Posted June 29, 2008 Author Share Posted June 29, 2008 What should be in the files top (header) and botton (footer). Yeah, I don't just have a bottom and top of the page. Where I want the content is part of the page if you look at the source of http://www.ev5unleash.com/home.php Quote Link to comment https://forums.phpfreaks.com/topic/112441-solved-php-include-complex/#findComment-577327 Share on other sites More sharing options...
ev5unleash Posted June 29, 2008 Author Share Posted June 29, 2008 Never mind, I modified it and I have fixed my problem. Quote Link to comment https://forums.phpfreaks.com/topic/112441-solved-php-include-complex/#findComment-577420 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.