Troublesome error.

I am developing an admin system for a forum, but I have met a problem which I can't seem to rectify. The server keeps telling me that I have "an unexpected $end on line 120". Please could someone shed some light on how I could fix this problem.

[code]
<?php

$page = FALSE;
$submit = FALSE;

extract($_GET);

if(!$page) {
echo "<html>
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo " Make New Forum

";
echo " Delete Forum

";
echo " Delete Post

";
echo " Bad Word Filter

";
echo "
";
echo "
";
echo "
";
echo "
";
}

if($page == "new") {
if($submit) {
if(!$forum_name || $forum_name == "") die("Could not complete operation. Please try again.");

if(file_exists($forum_name)) die("A directory by the name of $forum_name already exists. New Request");

$forum_name = str_replace(" ","_",$forum_name);

mkdir($forum_name);

$handle = fopen("directories.dat","a+") or die("Could not open file directories.dat.");
fwrite($handle,$forum_name."|");
fclose($handle);

$handle1 = fopen("$forum_name/index.dat","w") or die("Could not create file index.dat.");
fclose($handle1);

$handle2 = fopen("$forum_name/data.dat","w") or die("Could not create file data.dat.");
fclose($handle2);

echo "Directory $forum_name created. New Request";
}
if(!$submit) { ?>
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "Forum Name:  
";
echo "

";
echo "
";
echo "
";
echo "
";
}
}

if($page == "deldir") {
$abc = file_get_contents("directories.dat");
if($abc == "") die("No forums to delete. New Request");
if($submit) {
if(!$forum_name || $forum_name == "") die("Could not complete operation. Please try again.");
if(!file_exists($forum_name)) die("There is no directory by the name of $forum_name.");

unlink($forum_name."/index.dat");
unlink($forum_name."/data.dat");

rmdir($forum_name);

$handle = file_get_contents("directories.dat");
$handle = explode("|",$handle);

for($i=0;$idirectories.dat");
fwrite($handle2,$new_output);
fclose($handle2);
echo "Directory $forum_name deleted. New Request";
}
if(!$submit) {
$handle = fopen("directories.dat","r") or die("Could not open file directories.dat.");
$data = fread($handle,filesize("directories.dat"));
$data_s = explode("|",$data);
fclose($handle);

$data_s[count($data_s)-1] = NULL;

echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";

for($i=0;$i".$data_t[$i]."

";
}

echo "

";
echo "
";
echo "
";
echo "
";
}
}
?>
[/code]

Thanks in advance :-)

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion