Problem mit Darstellung im IE

Status
Nicht offen für weitere Antworten.

djandy

Mitglied
Hallo,

ich habe mir eine highlight_string-Funktion gebastelt aber ich Darstellung im Internet Explorer stimmt überhaupt nicht. Im Firefox wird alles 100% angezeigt.

Das Problem ist das der IE die overflow-Funktion irgendwie nicht benuzt und so alle Tabellen soweit verschiebt so das der Code angezeigt wird.

Meine IE-Version: 6.x

Hier mal der Code:

PHP:
 function extras($text) {
  	  
  	  
  	  $text = str_replace("&", "&", $text);
  	  $text = str_replace("&lt;", "<", $text);
  	  $text = str_replace("&gt;", ">", $text);
  	  $text = str_replace("&quot;", '"', $text);
  	  
  	  $match = array("/\[php\](.*?)\[\/php\]/se");
  	  
  	  $lines = explode("\n", $text);
  	  $numbers = "";
  	  
  		for($i = 0; $i < count($lines); $i++) {
  		$num = $i + 1;
  		$numbers .= $num .": "; }
  	  
 	 $replace = array("'<br><table width=\"80%\" border=\"0\" align=\"center\" cellspacing=\"0\"><tr><td><div style=\"overflow:auto; height:".(37+(count($lines)*16))."; width:100%\">PHP-Code:</div></td></tr></table><table width=\"80%\" border=\"0\" align=\"center\" cellspacing=\"0\"><tr><td width=\"4%\" valign=\"top\"><code>".$numbers."</code></td><td width=\"96%\" valign=\"top\"><div style=\"white-space:nowrap; overflow:auto;\"><code>'.highlight_string(stripslashes('$1'), true).'</code></div></td></tr></table><br>'");
  	
  	return preg_replace($match, $replace, $text); }

Hoffe Ihr könnt mir weiter helfen.

Gruß Andy
 
Darstellungsprobleme haben nichts mit PHP zu tun.
Das ist entweder HTML- oder CSS-Angelegenheit.

Ich schieb den Thread mal auf Verdacht ins HTML-Forum.
 
Jetzt noch der Quellcode Deiner CSS und HTML Datei, weil da muss irgendwo ein Fehler liegen. Ich habe mich da leider wohl ein wenig missverständlich ausgedrückt, weil von vornherein der Code interessanter als zwei Screenshots gewesen wäre. An dieser Stelle also sorry dafür.

Schönen Abend noch
Schubie
 
Hier mal der komplette Quelltext. Die CSS wird durch eine PHP-Funktion aufgerufen.


Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
     <head>
 	<style type="text/css">
     <!-- body 
                                        { font-family: Verdana, Helvetica;
 	                                     color: #000000;
 	                                     background-color: #ffffff;
 	                                     scrollbar-face-color: #f2f2f2;
                                          scrollbar-track-color: #87cefa;
                                          scrollbar-darkshadow-color: #87cefa;
                                          scrollbar-base-color: #87cefa;
                                          scrollbar-track-color: #f2f2f2;
                                          scrollbar-arrow-color: #87cefa;
                                          scrollbar-highlight-color: #f2f2f2;
                                          scrollbar-shadow-color: #f2f2f2; }
 	 
 
                                    .headline
                                       { font-size: 20px;
 	                                    font-family: Verdana, Helvetica }
 		 
    
                                    .link   
                                       { color: #87cefa;
                                         font-family: Verdana, Arial, Helvetica; 
                                         font-size: 12px;
                                         text-decoration: none; }    
 
 	
                                    .textfield  
                                       { font-family: Verdana, Arial, Helvetica; 
                                         font-size: 11px;
 	                                    color: #000000;
 	                                    border: #87cefa 1px solid;
 	                                    background-color: #f2f2f2; }
 
 
                                    .style1
                                       { border-bottom: #87cefa 1px solid;
                                         border-left: #87cefa 1px solid;
 	                                    border-right: #87cefa 1px solid;
 	                                    background-color: #ffffff;
 	                                    font-family: Verdana, Arial, Helvetica; 
                                         font-size: 11px; }
 	 
 
                                    .style2
                                       { border-bottom: #87cefa 1px solid;
 	                                    border-right: #87cefa 1px solid;
 	                                    background-color: #ffffff;
 	                                    font-family: Verdana, Arial, Helvetica; 
                                         font-size: 11px; }
 										
 										
 								 .style3
                                       { border-bottom: #87cefa 1px solid;
 	                                    border-left: #87cefa 1px solid;
 	                                    border-right: #87cefa 1px solid;
 	                                    background-color: #ffffff;
 	                                    font-family: Verdana, Arial, Helvetica; 
                                         font-size: 11px; }
 	 
 	  
                                    .text
                                       { font-family: Verdana, Arial, Helvetica; 
                                         font-size: 11px; }
 
  
                                    .text2
                                       { font-family: Verdana, Arial, Helvetica; 
                                         font-size: 14px; }
 										
 										
 								 .error_txt
                                       { color:#FF0000 } //-->
     </style>
 	<script type="text/javascript" src="functions.js"></script>
     <title>My-vBook</title>
      </head>
 	<br><div align="center">
 	<table width="600" border="0" align="center" cellspacing="0">
                                        <tr>
                                         <td class="textfield"><b>No. 4</b></td>
                                        </tr>
                                        </table>
                                        <table width="600" border="0" align="center" cellspacing="0">
                                        <tr>
                                        <td width="30%" rowspan="2" valign="top" class="style1">
                                        <b>Andy</b><br>
                                        26.11.2005 18:21
                                        <br>
                                         <br>
 <a href="mailto:%64%6A%61%6E%64%79%30%34%30%37%40%77%65%62%2E%64%65"><img src="http://192.168.0.1/my-vBook/images/email.gif" border="0" alt="djandy0407@web.de"/></a> 
                                        <br>
                                        </td>
 <td height="45" valign="top" class="style2"><br><table width="80%" border="0" align="center" cellspacing="0"><tr><td><div style="overflow:auto; height:341">PHP-Code:</div></td></tr></table><table width="80%" border="0" align="center" cellspacing="0"><tr><td width="4%" valign="top"><code>1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: </code></td><td width="96%" valign="top"><div style="white-space:nowrap; overflow:auto;"><code><code><font color="#000000"> <font color="#0000BB">&lt;?php<br />
 </font><font color="#007700">function </font><font color="#0000BB">badwords</font><font color="#007700">(&amp;</font><font color="#0000BB">$text_badwords</font><font color="#007700">) {<br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$drop_badwords </font><font color="#007700">= </font><font color="#0000BB">mysql_query</font><font color="#007700">(</font><font color="#DD0000">"SELECT <br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;badword <br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FROM <br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;badwords"</font><font color="#007700">);<br />
 <br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$count_badwords </font><font color="#007700">= </font><font color="#0000BB">mysql_num_rows</font><font color="#007700">(</font><font color="#0000BB">$drop_badwords</font><font color="#007700">);<br />
  <br />
 &nbsp;&nbsp;&nbsp;&nbsp;if (</font><font color="#0000BB">$count_badwords </font><font color="#007700">&gt; </font><font color="#0000BB">0</font><font color="#007700">) {<br />
 &nbsp;&nbsp;&nbsp;&nbsp;while (</font><font color="#0000BB">$get_badwords </font><font color="#007700">= </font><font color="#0000BB">mysql_fetch_array</font><font color="#007700">(</font><font color="#0000BB">$drop_badwords</font><font color="#007700">)) {<br />
 &nbsp;&nbsp;&nbsp;&nbsp;<br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$badwords&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">= </font><font color="#0000BB">strlen</font><font color="#007700">(</font><font color="#0000BB">$get_badwords</font><font color="#007700">[</font><font color="#DD0000">'badword'</font><font color="#007700">]);<br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$new_word&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">= </font><font color="#0000BB">str_repeat</font><font color="#007700">(</font><font color="#DD0000">"***"</font><font color="#007700">.</font><font color="#0000BB">$tm</font><font color="#007700">[</font><font color="#0000BB">64</font><font color="#007700">].</font><font color="#DD0000">"***"</font><font color="#007700">, </font><font color="#0000BB">$badwords</font><font color="#007700">);<br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$text_badwords&nbsp;&nbsp;</font><font color="#007700">= </font><font color="#0000BB">eregi_replace</font><font color="#007700">(</font><font color="#0000BB">$get_badwords</font><font color="#007700">[</font><font color="#DD0000">'badword'</font><font color="#007700">], </font><font color="#0000BB">$new_word</font><font color="#007700">, </font><font color="#0000BB">$text_badwords</font><font color="#007700">); } }<br />
  <br />
 &nbsp;&nbsp;&nbsp;&nbsp;return </font><font color="#0000BB">$text_badwords</font><font color="#007700">; } <br />
 </font><font color="#0000BB">?&gt;</font></font></code></code></div></td></tr></table><br></td>
                                        </tr>
                                        <tr>
                                        <td height="16" class="style2"> &nbsp;</td>
                                        </tr>
                                        </table></div> </body>
 </html>
 
Zuletzt bearbeitet von einem Moderator:
Habe den Code jetzt wie folgt geändert:

Code:
 echo "<?xml version=\"1.0\" encoding=\"".$encoding."\"?>
 	<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
 	<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"".$short."\" lang=\"".$short."\">
 	<head>
 	<style type=\"text/css\">
 	/* <![CDATA[ */ "; 
 	get_style();
 	
 	echo " /* ]]> */  -->
 	</style>
 	<script type=\"text/javascript\" src=\"functions.js\"></script>
 	<title>".$settings['guestbook_title']."</title>
 	</head>
 	<body>";

funktioniert aber immernoch nicht! Das das --> auch hinter /* ]]> weglassen. Keine Verbesserung der Ausgabe im IE...
 
Keine Garantie, daß es das Problem im IE löst, aber in deinem Stylesheet steckt noch immer der schliessende Kommentar -->.
 
Status
Nicht offen für weitere Antworten.
Zurück