Jump to content

[SOLVED] GET Page function not working.. pages don't load inside body with the css


sirkodo

Recommended Posts

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>

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.