sirkodo Posted August 4, 2008 Share Posted August 4, 2008 I have a problem with my websites not including the stylesheet or loading the page within the index. Here are the sites where it works. http://kodo.gtagaming.com/melc/pages/home http://kodo.gtagaming.com/mclc/pages/home Then I moved these sites to a different host and domain. http://www.michequinelaw.com http://www.michcondolaw.com The home pages come up working fine, but when you click any links it loads the page directly instead of inside the body content. No graphics, colors, or styling of any kind. This is the code I am using at the start of the index. <?php if($_GET['p']) $p=$_GET['p']; else $p="home"; ?> And here is more <div id="content"> <table cellpadding="0" cellspacing="0"> <tr> <td id="contentbody" width="599"> <?php include("pages/$p.php"); ?> </td> <td id="column" width="200"> <?php if(file_exists("pages/{$p}_right.php")) include("pages/{$p}_right.php"); else include("pages/home_right.php"); ?> </td> </tr> </table> </div> Quote Link to comment https://forums.phpfreaks.com/topic/118117-solved-get-page-function-not-working-pages-dont-load-inside-body-with-the-css/ Share on other sites More sharing options...
DeanWhitehouse Posted August 4, 2008 Share Posted August 4, 2008 are you sure the $_GET[]; isnt empty? Try echoin the vars , and see if they are what u expect Quote Link to comment https://forums.phpfreaks.com/topic/118117-solved-get-page-function-not-working-pages-dont-load-inside-body-with-the-css/#findComment-607689 Share on other sites More sharing options...
sirkodo Posted August 4, 2008 Author Share Posted August 4, 2008 are you sure the $_GET[]; isnt empty? Try echoin the vars , and see if they are what u expect Sorry can you dumb it down for me? I'm quite php illiterate. My friend wrote that code for me and I understand how it worked on the other sites, but I don't understand how to adapt it to work again. Quote Link to comment https://forums.phpfreaks.com/topic/118117-solved-get-page-function-not-working-pages-dont-load-inside-body-with-the-css/#findComment-607691 Share on other sites More sharing options...
DeanWhitehouse Posted August 4, 2008 Share Posted August 4, 2008 under the get bit add echo $_GET['p']; echo "<br>".$p; Quote Link to comment https://forums.phpfreaks.com/topic/118117-solved-get-page-function-not-working-pages-dont-load-inside-body-with-the-css/#findComment-607693 Share on other sites More sharing options...
sirkodo Posted August 4, 2008 Author Share Posted August 4, 2008 under the get bit add echo $_GET['p']; echo "<br>".$p; No this did not work it seems. I have: <?php if($_GET['p']) $p=$_GET['p']; else $p="home"; echo $_GET['p']; echo " ".$p; ?> Quote Link to comment https://forums.phpfreaks.com/topic/118117-solved-get-page-function-not-working-pages-dont-load-inside-body-with-the-css/#findComment-607718 Share on other sites More sharing options...
DeanWhitehouse Posted August 4, 2008 Share Posted August 4, 2008 does it echo out anything? Quote Link to comment https://forums.phpfreaks.com/topic/118117-solved-get-page-function-not-working-pages-dont-load-inside-body-with-the-css/#findComment-607720 Share on other sites More sharing options...
sirkodo Posted August 4, 2008 Author Share Posted August 4, 2008 From what I can see it printed the word 'home' at the top of the site. Quote Link to comment https://forums.phpfreaks.com/topic/118117-solved-get-page-function-not-working-pages-dont-load-inside-body-with-the-css/#findComment-607728 Share on other sites More sharing options...
wildteen88 Posted August 4, 2008 Share Posted August 4, 2008 I believe your orginal site http://kodo.gtagaming.com/melc/pages/home uses a technique called mod_rewrite, because if I goto http://kodo.gtagaming.com/melc/pages/services it'll load up the services page, so does http://kodo.gtagaming.com/melc/index.php?p=services mod_rewrite allows you to make url aliases, eg pages/services actually calls index.php?p=services However on your other sites index.php doesn't seem exist and the clean urls don't work. How I see it index.php is used to load the requested page into your main site design. On your other sites you are physically calling the files and thus your site design disappears. EDIT: Hold on index.php does exist except its in the root of the site, this works http://www.michequinelaw.com/index.php?p=services however http://www.michequinelaw.com/pages/services.php doesn't because your physically calling services.php, whereas the above url calls index.php which includes pages/services.php into your site design. Quote Link to comment https://forums.phpfreaks.com/topic/118117-solved-get-page-function-not-working-pages-dont-load-inside-body-with-the-css/#findComment-607736 Share on other sites More sharing options...
sirkodo Posted August 4, 2008 Author Share Posted August 4, 2008 You nailed it Thankyou Quote Link to comment https://forums.phpfreaks.com/topic/118117-solved-get-page-function-not-working-pages-dont-load-inside-body-with-the-css/#findComment-607744 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.