$end=fixed | now => $file undefined error
Posted: Tue Jun 15, 2004 7:02 pm
Tried differant things.. but i just cant find my error.
i knows its in the write_news part but.. cant find it did try the most common thing by adding the } at the end however that didnt seem to do the trick
i knows its in the write_news part but.. cant find it did try the most common thing by adding the } at the end however that didnt seem to do the trick
line 70 is ofcourse the last line..Parse error: parse error, unexpected $end on line 70
Code: Select all
<?
require_once("inc/config.inc");
switch($shownews)
{
case 'default':
echo '<html><head><title>"'.$site_name.'" News</title></head>';
echo '<body bgcolor="#EEEEEE" text="#000000">';
echo '<center><h1>'.$site_name.' News</h1></center>';
$gd = getdate();
$filename = "news/news".$gd["mday"]."-".$gd["mon"]."-".$gd["year"].".txt";
if (!((file_exists($filename)) || is_file($file_name) || is_readable($filename)))
{
die(":NEWS FILE ERROR::");
}
$data=file($filename);
echo "<table align="center">";
echo "<tr><td><h1>".$data[0]."</h1></td></tr>";
echo "<tr><td>";
for ($i=1;$i<count($data);$i++)
{
echo "</table>";
}
break;
case 'write_news':
echo '<html><head><title>"'.$site_name.'" News</title><head>';
echo '<body bgcolor="#EEEEEE" text="#000000">';
echo '<table width="600" border="1" align="center" bordercolor="#000000" cellspacing="0">';
echo '<tr><td width="300" height="146" bgcolor="#EEEEEE">';
echo '<form name="write_news" method="post" action="write_admin_news.php">';
echo '<table width="48%" border="0" algin="center">';
echo '<tr><td><center><b>Add "'.$site_name.'" News</b></center></td></tr>';
echo '<tr><td><center><input typ="text" name="headline" size="35">';
echo '</center></td></tr>';
echo '<tr><td><center><b>Main Article</b></center></td></tr>';
echo '<center><TEXTAREA NAME="news" ROWS="7" COLS="30"></TEXTAREA></center></td></tr>';
echo '<tr><td><div align="center">';
echo '<input type="submit" name="submit" value="submit">';
echo '</div></td></tr></table></form></td>';
echo '<td width="300" height="146" bgcolor="#EEEEEE">';
echo '<form name="old_news" method="post" action="write_admin_news.php">';
echo '<p align="center">';
echo '<select name="select"size="1"><option value="0">Old News</option>';
if (!((file_exists("news")) || (is_dir("news"))))
{
mkdir("news",0700);
}
else
{
$filelist = opendir('news'/');
while($file=readdir($file));
{
if (is_file($file))
{
echo "<option value="".$file."" >".$file."(".$filetype($file).")</option>";
}
}
}
?>
</select></p>
<p align="center"><input type="radio" name="radio" value="delete">
<b>Delete!</b></p>
<p align="center">
<input type="submit" name="submit2" value="submit"></p></form></td></tr></table>
</body></html>
<?
break;
}
}
?>