Jump to content


Layout doesnt show up in IE with PHP.


14 replies to this topic

#1 pistonsfreak

    Young Padawan

  • Members
  • Pip
  • 174 posts

Posted 06 February 2008 - 06:43 PM

Alright I have my layout all set and everything. You can view my site fine on Firefox and Internet Explorer. But then when I add some PHP to my page, the layout only shows up in FF and not IE. Heres a screenshot from Firefox with the PHP: http://www.sportzin....-1202340995.jpg. Here is what it looks like in IE: http://www.sportzin....-1202341250.jpg. And here is my code for my webpage:

<title>Sportz Insomnia</title>
<style type="text/css">
<!--
body {
	background-color: #292828;
	background-repeat: no-repeat;
	background-position: center;
	
}

#Layer1 {
	position:absolute;
	width:463px;
	height:320px;
	z-index:1;
	left: 371px;
	top: 363px;
}
.style1 {font-family: Arial, Helvetica, sans-serif}
#Layer2 {
	position:absolute;
	width:440px;
	height:294px;
	z-index:1;
	left: 376px;
	top: 364px;
}
</style>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
	<td><table id="Table_01" width="950" height="200" border="0" cellpadding="0" cellspacing="0">
		<tr>
		  <td colspan="9"><img src="images/header_01.gif" width="950" height="10" alt="" /></td>
		</tr>
		<tr>
		  <td rowspan="4"><img src="images/header_02.gif" width="63" height="190" alt="" /></td>
		  <td colspan="7"><a href="index.php"> <img src="images/Untitled-1_03.gif" width="825" height="127" border="0" alt="" /></a></td>
		  <td rowspan="4"><img src="images/header_04.gif" width="62" height="190" alt="" /></td>
		</tr>
		<tr>
		  <td colspan="7"><img src="images/header_05.gif" width="825" height="36" alt="" /></td>
		</tr>
		<tr>
		  <td rowspan="2"><img src="images/header_06.gif" width="172" height="27" alt="" /></td>
		  <td><a href="index.php"> <img src="images/Untitled-1_07.gif" width="61" height="19" border="0" alt="" /></a></td>
		  <td><a href="forums/"> <img src="images/Untitled-1_08.gif" width="77" height="19" border="0" alt="" /></a></td>
		  <td><a href="http://www.sportzin.com/forums/index.php?autocom=gallery"> <img src="images/Untitled-1_09.gif" width="116" height="19" border="0" alt="" /></a></td>
		  <td><a href="cutgallery/"> <img src="images/Untitled-1_10.gif" width="113" height="19" border="0" alt="" /></a></td>
		  <td><a href="contact.php"> <img src="images/Untitled-1_11.gif" width="115" height="19" border="0" alt="" /></a></td>
		  <td rowspan="2"><img src="images/header_12.gif" width="171" height="27" alt="" /></td>
		</tr>
		<tr>
		  <td colspan="5"><img src="images/header_13.gif" width="482" height="8" alt="" /></td>
		</tr>
	  </table></td>
  </tr>
  <tr>
  </tr>
</table>
<table width="950" height="140" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
	<th height="140" background="images/bodytop.gif" scope="col">&nbsp;</th>
  </tr>
</table>
<table width="950" height="336" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
	<th width="343" height="336" background="images/bodyleft.gif" scope="col">
	<th width="484" background="images/news.gif" scope="col"><div id="Layer2"><?PHP
$number=1;
$category=1;
include("/home/sportz/public_html/news/show_news.php");
?></div></th>
	<th width="123" scope="col" background="images/bodyright.gif">&nbsp;</th>
  </tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
	<th height="191" background="images/bodybottom.gif" scope="col">&nbsp;</th>
  </tr>
</table>

Please help me, thanks.

#2 fiv3isaliv3

    Young Padawan

  • Members
  • Pip
  • 258 posts
  • Gender:Male

Posted 06 February 2008 - 07:15 PM

Well since it is PHP which seems to be causing the issue... you should include the PHP. Also try using a third party to take the screenshots such as browsershots.org. :)

#3 pistonsfreak

    Young Padawan

  • Members
  • Pip
  • 174 posts

Posted 06 February 2008 - 07:22 PM

What you mean include the PHP...

#4 fiv3isaliv3

    Young Padawan

  • Members
  • Pip
  • 258 posts
  • Gender:Male

Posted 06 February 2008 - 07:46 PM

The PHP source code... what else could I mean?

#5 pistonsfreak

    Young Padawan

  • Members
  • Pip
  • 174 posts

Posted 06 February 2008 - 07:51 PM

<th width="484" background="images/news.gif" scope="col"><div id="Layer2"><?PHP
$number=1;
$category=1;
include("/home/sportz/public_html/news/show_news.php");
?>
</div></th>

#6 fiv3isaliv3

    Young Padawan

  • Members
  • Pip
  • 258 posts
  • Gender:Male

Posted 06 February 2008 - 08:15 PM

What is in show news? any why do you have a div within a table?

#7 pistonsfreak

    Young Padawan

  • Members
  • Pip
  • 174 posts

Posted 06 February 2008 - 08:23 PM

show news shows the news that i want to post.... i added the div to see if it would work but it didnt

#8 fiv3isaliv3

    Young Padawan

  • Members
  • Pip
  • 258 posts
  • Gender:Male

Posted 06 February 2008 - 08:24 PM

Yeah dude... you don't understand this debugging thing. I can't offer suggestions if you don't provide some source code. What you've given isn't enough.

#9 pistonsfreak

    Young Padawan

  • Members
  • Pip
  • 174 posts

Posted 06 February 2008 - 08:39 PM

source code of what? the show news script?

#10 pistonsfreak

    Young Padawan

  • Members
  • Pip
  • 174 posts

Posted 06 February 2008 - 09:44 PM

Heres show news code, I am pretty sure though that any PHP I put in there makes the layout not show up, not just show_news.php

<?PHP

error_reporting (E_ALL ^ E_NOTICE);

$cutepath =  __FILE__;
$cutepath = preg_replace( "'\\\show_news\.php'", "", $cutepath);
$cutepath = preg_replace( "'/show_news\.php'", "", $cutepath);

require_once("$cutepath/inc/functions.inc.php");
require_once("$cutepath/data/config.php");

// If we are showing RSS, include some need variables.
if($template == 'rss'){
   include("$cutepath/data/rss_config.php");
}

//----------------------------------
// Check if we are included by PATH
//----------------------------------
if($HTTP_SERVER_VARS["HTTP_ACCEPT"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_CHARSET"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"] or $HTTP_SERVER_VARS["HTTP_CONNECTION"]){ /* do nothing */ }
elseif(eregi("show_news.php", $PHP_SELF)){
die("<h4>CuteNews has detected that you are including show_news.php using the URL to this file.<br>
This is incorrect and you must include it using the PATH to show_news.php</h4><br>Example:<br>
this is <font color=red>WRONG</font> :&nbsp;&nbsp; &lt;?PHP include(\"http://yoursite.com/cutenews/show_news.php\"); ?&gt;<br>
this is <font color=green>CORRECT</font>:&nbsp;&nbsp; &lt;?PHP include(\"cutenews/show_news.php\"); ?&gt;<br>
<br><BR>// <font size=2>if you think this message shouldn't be shown, open show_news.php and delete it from there</font>");
}
//----------------------------------
// End of the check
//----------------------------------

if(!isset($subaction) or $subaction == ""){ $subaction = $POST["subaction"]; }

if(!isset($template) or $template == "" or strtolower($template) == "default"){ require_once("$cutepath/data/Default.tpl"); }
else{
		if(file_exists("$cutepath/data/${template}.tpl")){ require("$cutepath/data/${template}.tpl"); }
	else{ die("Error!<br>the template <b>".htmlspecialchars($template)."</b> does not exists, note that templates are case sensetive and you must write the name exactly as it is"); }
}

// Prepare requested categories
if(eregi("[a-z]", $category)){
		die("<b>Error</b>!<br>CuteNews has detected that you use \$category = \"".htmlspecialchars($category)."\"; but you can call the categories only with their <b>ID</b> numbers and not with names<br>
	example:<br><blockquote>&lt;?PHP<br>\$category = \"1\";<br>include(\"path/to/show_news.php\");<br>?&gt;</blockquote>");
}
$category = preg_replace("/ /", "", $category);
$tmp_cats_arr = explode(",", $category);
foreach($tmp_cats_arr as $key=>$value){
	if($value != ""){ $requested_cats[$value] = TRUE; }
}

if($archive == ""){
		$news_file = "$cutepath/data/news.txt";
		$comm_file = "$cutepath/data/comments.txt";
}else{
		$news_file = "$cutepath/data/archives/$archive.news.arch";
		$comm_file = "$cutepath/data/archives/$archive.comments.arch";
}

$allow_add_comment						= FALSE;
$allow_full_story						= FALSE;
$allow_active_news						 = FALSE;
$allow_comments						 = FALSE;



//<<<------------ Detarime what user want to do
if( $CN_HALT != TRUE and $static != TRUE and ($subaction == "showcomments" or $subaction == "showfull" or $subaction == "addcomment") and ((!isset($category) or $category == "") or ($requested_cats[$ucat] == TRUE )  ) ){
	if($subaction == "addcomment"){  $allow_add_comment		= TRUE; $allow_comments = TRUE; }
	if($subaction == "showcomments"){ $allow_comments = TRUE; }
	if(($subaction == "showcomments" or $allow_comments == TRUE) and $config_show_full_with_comments == "yes"){$allow_full_story = TRUE; }
	if($subaction == "showfull") $allow_full_story = TRUE;
	if($subaction == "showfull" and $config_show_comments_with_full == "yes") $allow_comments = TRUE;

}
else{
	if($config_reverse_active == "yes"){ $reverse = TRUE; }
		$allow_active_news = TRUE;
}
//----------->>> Detarime what user want to do

require("$cutepath/inc/shows.inc.php");
	if($_GET['archive'] and $_GET['archive'] != ''){ $archive = $_GET['archive']; } // stupid fix ?
unset($static, $template, $requested_cats, $category, $catid, $cat,$reverse, $in_use, $archives_arr, $number, $no_prev, $no_next, $i, $showed, $prev, $used_archives);
?>


#11 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 06 February 2008 - 11:48 PM

My opinion, this isn't a PHP problem. This is a problem with having used photoshop or fireworks to slice up the template, and then trying to include some html that doesn't belong where you're including it.

So, now that we have the source code for almost everything, could you do me one favor? Since you blacked out the url of the page, go to the page you are asking about, right click>view source, and then copy/paste what shows up in notepad here so we can see what the finished product is and hopefully narrow down where the problem is.

View Postzealivity5, on Feb 6 2008, 05:15 PM, said:

...try using a third party to take the screenshots such as browsershots.org. ;)
You know, in all my time of being around website development, i've never heard of doing such a thing to aid in debugging... Out of curiosity, how is a 3rd party screenshot like that supposed to be helpfull?
I just want your reasoning behind it... who knows, it may come in handy down the line somewhere.
:)

#12 fiv3isaliv3

    Young Padawan

  • Members
  • Pip
  • 258 posts
  • Gender:Male

Posted 07 February 2008 - 12:50 PM

rc69 to get rid of the possibility it is on his end... since he wasn't providing the URL I have no way of knowing if it is simply IE or Fx configured improperly hence the page not displaying correctly. Working in tech support for 2 years I generally like to rule out the user first. :biggrin:

As far as why I asked for the PHP... wanted to make sure there wasn't an include for another CSS file or something that might make everything screwy for one browser and not for the other.

--

Anyway, looks to me like the PHP is fine. Seems to be an issue with slicing. Ask for templating help on the forums for cutephp. http://cutephp.com/forum/

Edited by zealivity5, 07 February 2008 - 12:55 PM.


#13 pistonsfreak

    Young Padawan

  • Members
  • Pip
  • 174 posts

Posted 07 February 2008 - 02:07 PM

K, heres the source from when I right click the page. No PHP is included in this.

<title>Sportz Insomnia</title>
<style type="text/css">
<!--
body {
	background-color: #292828;
	background-repeat: no-repeat;
	background-position: center;
	
}

#Layer1 {
	position:absolute;
	width:463px;
	height:320px;
	z-index:1;
	left: 371px;
	top: 363px;
}
.style1 {font-family: Arial, Helvetica, sans-serif}
#Layer2 {
	position:absolute;
	width:440px;
	height:294px;
	z-index:1;
	left: 376px;
	top: 364px;
}
</style>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
	<td><table id="Table_01" width="950" height="200" border="0" cellpadding="0" cellspacing="0">
		<tr>
		  <td colspan="9"><img src="images/header_01.gif" width="950" height="10" alt="" /></td>
		</tr>
		<tr>

		  <td rowspan="4"><img src="images/header_02.gif" width="63" height="190" alt="" /></td>
		  <td colspan="7"><a href="index.php"> <img src="images/Untitled-1_03.gif" width="825" height="127" border="0" alt="" /></a></td>
		  <td rowspan="4"><img src="images/header_04.gif" width="62" height="190" alt="" /></td>
		</tr>
		<tr>
		  <td colspan="7"><img src="images/header_05.gif" width="825" height="36" alt="" /></td>
		</tr>
		<tr>

		  <td rowspan="2"><img src="images/header_06.gif" width="172" height="27" alt="" /></td>
		  <td><a href="index.php"> <img src="images/Untitled-1_07.gif" width="61" height="19" border="0" alt="" /></a></td>
		  <td><a href="forums/"> <img src="images/Untitled-1_08.gif" width="77" height="19" border="0" alt="" /></a></td>
		  <td><a href="http://www.sportzin.com/forums/index.php?autocom=gallery"> <img src="images/Untitled-1_09.gif" width="116" height="19" border="0" alt="" /></a></td>
		  <td><a href="cutgallery/"> <img src="images/Untitled-1_10.gif" width="113" height="19" border="0" alt="" /></a></td>
		  <td><a href="contact.php"> <img src="images/Untitled-1_11.gif" width="115" height="19" border="0" alt="" /></a></td>

		  <td rowspan="2"><img src="images/header_12.gif" width="171" height="27" alt="" /></td>
		</tr>
		<tr>
		  <td colspan="5"><img src="images/header_13.gif" width="482" height="8" alt="" /></td>
		</tr>
	  </table></td>
  </tr>
  <tr>
  </tr>

</table>
<table width="950" height="140" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
	<th height="140" background="images/bodytop.gif" scope="col">&nbsp;</th>
  </tr>
</table>
<table width="950" height="336" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
	<th width="343" height="336" background="images/bodyleft.gif" scope="col">
	<th width="484" background="images/news.gif" scope="col"></th>
	<th width="123" scope="col" background="images/bodyright.gif">&nbsp;</th>

  </tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
	<th height="191" background="images/bodybottom.gif" scope="col">&nbsp;</th>
  </tr>
</table>


#14 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 07 February 2008 - 04:44 PM

Mmk, let me rephrase.

View Postrc69, on Feb 6 2008, 10:48 PM, said:

...go to the page you are asking about, right click>view source, and then copy/paste what shows up in notepad here so we can see what the finished product is...
When i said that, i meant everything.

That aside, if what i'm reading is correct, then your problem is invalid html... severley invalid html.
1. You're missing the <html> <head> and <body> tags.
2. You're including the <title> and <style> attributes twice, and in what the browser would assume to be the <body>.

Other then that, i don't have time to figure out whether or not a tag is missing somewhere. But given that it was probably made in photoshop, i doubt that's the case. Who knows though.

Quote

rc69 to get rid of the possibility it is on his end... since he wasn't providing the URL I have no way of knowing if it is simply IE or Fx configured improperly hence the page not displaying correctly. Working in tech support for 2 years I generally like to rule out the user first
Ahhh, i see.
I don't believe such a problem could be caused by a browser configuration error, but at least i now know why something like that may be useful. Thanks :biggrin:

#15 pistonsfreak

    Young Padawan

  • Members
  • Pip
  • 174 posts

Posted 07 February 2008 - 06:14 PM

WOW, yeah that was totally my bad, for some reason the head code got delete in Dreamweaver when I went to code the site. So its fixed now.

Thanks





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users