Page 1 of 1

help with iframes and PHP[unsolved]

Posted: Tue Oct 11, 2005 3:48 pm
by Charles256
please please please please help...The problem is it's loading the entire main page up inside of the iframe and then making a new iframe..here is the relevant code..if you need to see any other code just let me know and i'll post it asap.
As a side note the link doesn't actually change the URL yet the page changes.. :-/
body.php

Code: Select all

<div id="nav"><a href="index.php?page=testing" target="dc">testing</a></div>
		
	<?php
if (!isset($_REQUEST['page']))
	{
		$_REQUEST['page']="NULL";
	}
	$page=$_REQUEST['page'];
		if ($page=="NULL")
		{
			echo("
			<div id='dlx'></div>
			<div id='banner'></div>
			<div id='grave'></div>
			<div id='defaultbody'>");
			echo("<iframe src='default.php' width='100%' height='120px' scroll='yes' border='0' name='dc'>You need to enable frames to view this site. Thank you.</iframe>");
			echo ("</div>
			<div id='mini'>");
		}
		else
		{
		echo ("<div id='mainbody'>");
		echo ("<iframe src='".$page.".php' width='100%' height='300px' scroll='yes' border='0' name='dc'>You need to enable frames to view this site. Thank you.</iframe>");
		}
	?>
	</div>
testing.php (the page that loads within the iframe making a new iframe..weird..)

Code: Select all

we are testing the power of the code my unfamilair buddy.we are testing the power of the code my unfamilair buddy.we are testing the power of the code my unfamilair buddy.we are testing the power of the code my unfamilair buddy.we are testing the power of the code my unfamilair buddy.we are testing the power of the code my unfamilair buddy.we are testing the power of the code my unfamilair buddy.we are testing the power of the code my unfamilair buddy.we are testing the power of the code my unfamilair buddy.we are testing the power of the code my unfamilair buddy.we are testing the power of the code my unfamilair buddy.we are testing the power of the code my unfamilair buddy.
one last side note if i manually type in index.php?page=testing it works just fine..grrr...

Posted: Tue Oct 11, 2005 4:01 pm
by feyd
is this page set to standards compliance mode?

Posted: Tue Oct 11, 2005 4:04 pm
by Charles256

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
that give ya the info ya need?

Posted: Tue Oct 11, 2005 4:25 pm
by Charles256
i've tried changing the doc type but then the rest of my layout messes up:-/ either way the HTML validates with some minor changes..yet still the same problem..
edit: something else that is really odd.. if i type in the addy say http://localhost and then click the link it doesn't work.however if i shift click it it opens in a new windows and from then i can click the links and it displays properly.
edit2:
new code...

Code: Select all

<div id="nav"><a href="index.php?page=testing" target="dc">testing</a>
	<br>
	<a href="index.php?page=NULL" target="dc">Home</a></div>
		
	<?php
	if (!isset($_REQUEST['page']))
	{
		$_REQUEST['page']="NULL";
	}
	$page=$_REQUEST['page'];
		if ($page=="NULL")
		{
			echo("
			<div id='dlx'></div>
			<div id='banner'></div>
			<div id='grave'></div>
			<div id='defaultbody'>");
			echo("<iframe src='default.php' width='100%' height='120px' name='cd'>You need to enable frames to view this site. Thank you.</iframe>");
			echo ("</div>
			<div id='mini'></div>");
		}
		else
		{
		echo ("<div id='mainbody'>");
		echo ("<iframe src='".$page.".php' width='100%' height='300px' name='dc'>You need to enable frames to view this site. Thank you.</iframe></div>");
		}
	?>
it is now loading a new window when i click the link and once it gets in the new window i can go back and forth with the links as if life is grand....why is it opening the new window on the first click?

Posted: Wed Oct 12, 2005 5:33 pm
by Charles256
anything i can do t omake it clearer?