Kod strony wygląda tak:
Kod
<?PHP
include '_naglowek.php';
?>
<title></title>
<h1>Najnowsze wiadomości</h1>
<div class="left_box_inner">
<br /><br />
<?php
$file = file("newsy.txt");
foreach($file as $value) {
$exp = explode("`",$value);
echo '<div class="videographytext">
<h2>';
echo $exp[0];
echo '</h2>
<div class="left_box_inner">';
echo $exp[1];
echo '<br />
<div class="news_bottom">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="33%">
<div align="left">';
echo $exp[2];
echo '</div>
</td>
<td width="34%">
<div align="center"><a class="retweet" href="">
Więcej...
</a>
</div>
</td>
<td width="33%">
<div align="right">
<strong>
by: ';
echo $exp[3];
echo '</strong>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="clear"></div>
<div class="divider"></div>';
?>
<style type="text/css">
<!--
.style01 {
font-size: 10px;
font-family: Arial, Helvetica, sans-serif;
}
-->
</style>
<br />
<br />
</div>
<?PHP
include '_stopka.php';
?>
include '_naglowek.php';
?>
<title></title>
<h1>Najnowsze wiadomości</h1>
<div class="left_box_inner">
<br /><br />
<?php
$file = file("newsy.txt");
foreach($file as $value) {
$exp = explode("`",$value);
echo '<div class="videographytext">
<h2>';
echo $exp[0];
echo '</h2>
<div class="left_box_inner">';
echo $exp[1];
echo '<br />
<div class="news_bottom">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="33%">
<div align="left">';
echo $exp[2];
echo '</div>
</td>
<td width="34%">
<div align="center"><a class="retweet" href="">
Więcej...
</a>
</div>
</td>
<td width="33%">
<div align="right">
<strong>
by: ';
echo $exp[3];
echo '</strong>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="clear"></div>
<div class="divider"></div>';
?>
<style type="text/css">
<!--
.style01 {
font-size: 10px;
font-family: Arial, Helvetica, sans-serif;
}
-->
</style>
<br />
<br />
</div>
<?PHP
include '_stopka.php';
?>
Plik z newsami wygląda tak:
Kod
Tytuł newsa`Treść newsa.`05.11.2011`admin
Tytuł newsa2`Treść newsa2.`05.11.2011`admin
Tytuł newsa2`Treść newsa2.`05.11.2011`admin
Czy błąd jest przez to, że na przykład znaczniki otwierające HTML są w pliku z include'', a zamykające na tej stronie?