Jump to content

website doubles itself?


MasterACE14

Recommended Posts

Hello,

 

I'm using the jQuery library and in particular the AJAX part of it. It's all working fine except for one thing...

I have 3 divs which are loaded through the use of AJAX, #left, #contentmain and #right.

in #contentmain each PHP file it loads has...

require_once("GETengine-1.0.0/index.php");

...in it.

 

I want to put that in the PHP file that is loaded in #right as well. However when I do that the website doubles.

By doubling I mean you can see the whole website, and then the exact same website seems to overlap the original like the following...

css-layers-01.gif

however its my 'exact' website doubled twice.

 

It only happens when I add that require_once into the PHP file I load into #right.

 

Here is rightpanel.php (the PHP file loaded into #right):

<?php
require_once("GETengine-1.0.0/index.php");
session_start();
//	require_once("config.php");
//	require_once("connect.inc.php");
//	require_once("includes.php");
if(isset($_SESSION['userid']))
{
	$user = userDetails($_SESSION['userid']);

	$xpPerc = (($user['exp']/XP($user['level']))*100);
	echo "Level ".$user['level'];
	echo "<img src=\"images/exp.php?percent=".$perc."\" alt=\"".XP($user['level'])."%"."\" />";
	echo "<div style=\"font-size: 8pt; overflow: visible;\">".number_format($user['exp'])." / ".number_format(XP($user['level']))." xp</div>";

	echo "<div style=\"font-size: 8pt; overflow: visible; border-top: 1px solid #000;\">";
	echo number_format($user['diamonds'])." diamonds<br />";
	echo number_format($user['titanium'])." titanium";
	echo "</div>";

	echo "<div style=\"font-size: 8pt; overflow: visible; border-top: 1px solid #000;\">";
	echo "</div>";
}
?>

 

here is the AJAX call for rightpanel.php into the #right div:

	$.ajax({
	type: "POST", url: 'rightpanel.php',
	async: true,
	success: function(html){$("#right").html(html);}
});

 

If more code is required to determine the problem, please let me know.

 

Cheers, Ace

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.