<?
include 'header.php';
include '.../.../.../.../.../awoemxcjfdyueycndueuejdlasfweoiociuoawenlskkcucose enselicusoien.txt';
echo "<link rel=\"stylesheet\" href=\".../.../.../.../font.css\" type=\"text/css\">";
?>
<?
$filename = ".../.../.../.../.../scripts.txt";
$whattoread = @fopen($filename, "r") or die("There has been an error processing our contact script, please email the administrator
email@digital-syntax.com.au");
$old_contents = fread($whattoread, filesize($filename));
fclose($whattoread);
// writes $newstring to text file erasing any data that is already in that file
$filename = ".../.../.../.../.../scripts.txt";
$name = $_POST['name'];
$pagelink = $_POST['pagelink'];
$size = $_POST['size'];
$completed = $_POST['completed'];
$function = $_POST['function'];
$description = $_POST['description'];
$file = $_POST['file'];
$pw = $_POST['pw'];
$overall = "
<br><span class=\"size2darkblue\"><table width=\"80%\" style=\"border-collapse: collapse\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\"
align=\"center\" bordercolor=\"313d4f\" class=\"size2darkblue\">
<tr>
<td width=\"40%\"><b>Name:</b></td>
<td width=\"60%\">$name</td>
</tr>
<tr>
<td width=\"40%\"><b>Function:</b></td>
<td width=\"60%\">$function</td>
</tr>
<tr>
<td width=\"40%\"><b>Completed:</b></td>
<td width=\"60%\">$completed</td>
</tr>
<tr>
<td width=\"40%\"><b>Size:</b></td>
<td width=\"60%\">$size</td>
</tr>
<tr>
<td width=\"40%\" valign=\"top\"><b>Description:</b></td>
<td width=\"60%\">$description</td>
</tr>
</table>
<table border=\"0\" cellpadding=\"1\" align=\"center\" width=\"100%\">
<tr>
<td width=\"50%\" class=\"size2darkblue\" align=\"right\"><b><u>Download:</u></b></td>
<td width=\"50%\" align=\"left\"> <a href=\"scripts/$file\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage(
'$file','','images/download_down.gif',1)\"><img name=\"$file\" border=\"0\" class=\"images\" src=\"images/download.gif\" width=\"20\" height=
\"22\" ></a></td>
</tr>
</table></span>";
if ($pw == "$password") {
$newfile = fopen($filename, "w+");
@fwrite($newfile, "$overall"."<img src=\"images/line.gif\"><br>");
fclose($newfile);
// adds the variable $old_contents to contact.txt after the new news update
$filename = ".../.../.../.../.../scripts.txt";
$newfile2 = @fopen($filename, "a");
@fwrite($newfile2, $old_contents);
fclose($newfile2);
echo "<p>The following was added to the scripts page:</p>";
echo "<span class=\"size2darkblue\"><table width=\"80%\" style=\"border-collapse: collapse\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\"
align=\"center\" bordercolor=\"313d4f\" class=\"size2darkblue\">
<tr>
<td width=\"40%\"><b>Name:</b></td>
<td width=\"60%\">$name</td>
</tr>
<tr>
<td width=\"40%\"><b>Function:</b></td>
<td width=\"60%\">$function</td>
</tr>
<tr>
<td width=\"40%\"><b>Completed:</b></td>
<td width=\"60%\">$completed</td>
</tr><tr>
<td width=\"44%\"><b>Size:</b></td>
<td width=\"56%\">
$size
</td>
</tr>
<tr>
<td width=\"40%\" valign=\"top\"><b>Description:</b></td>
<td width=\"60%\">$description</td>
</tr>
<tr>
<td width=\"40%\"><b>Download:</b></td>
<td width=\"60%\"><a href=\"download.localhost/$file\" class=\"size2darkblue\" target=\"_blank\">$file</a></td>
</tr>
</table></span>";
echo "<p align=\"center\"><a href=\"add_script.php\" class=\"size2darkblue\">Add another one</a>";
$blue = "1";
//increments the $count by 1
$log="../../../../../script-count.txt";
$open=@fopen($log,'r+');
$counter=@fread($open,filesize($log));
@fclose($open);
if ($counter == "5") {
$fh = fopen($log, "w");
fwrite($fh, $blue);
fclose($fh);
}
else
{
$counter++;
$write=fopen($log,'w');
fputs($write,$counter);
fclose($write);
}
$updatesfilename = "../../../../../update"."$count".".txt";
$updatingcode = '
<a href="scripts/' . $pagelink . '" class="size12vdarkblue">' . $name . '</a>';
$updatesfile = fopen($updatesfilename, "w");
fwrite($updatesfile, "$updatingcode");
fclose($updatesfile);
} else {
echo "Sorry but you are not authorized to do that.";
}
?>
<?
include 'footer.php';
?>
*********************
this is the whole coding, it ads to a file name depending on the count. what's wrong with it?
*********************