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
https://forums.phpfreaks.com/topic/184051-website-doubles-itself/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.