I added the following code to my index.php file but for sum reason the code is not working. can anyone help or tell me what to change?
//upload
else if($action=="upload")
{
echo webhead($uthm,$stitle);
echo "<p align=\"center\">";
if ($upload="upload"&&$superdat_name)
{
if (!eregi("\.(png)$",$superdat_name))
{
echo "[b]Unsuported File extention!!![/b]";
}
else
{
$superdat_name = preg_replace('/[^a-zA-Z0-9\.\$\%\'\`\-\@\{\}\~\!\#\(\)\&\_\^]/','',str_replace(array(' ','%20'),array('_','_'),$superdat_name));
if(strlen($superdat_name)>53)
{
echo "[b]File Name to long!!![/b]";
}
else
{
if (empty($superdat))
{
echo "[b]No input file specified!!![/b]";
}
else
{
copy("$superdat", "upload/$superdat_name")
or die("Couldn't copy file.");
}
echo "[b]$superdat_name[/b] has been successfully uploaded";
}
}
}
else
{
echo "<form action=\"index.php?action=upload&ses=$ses\" method=\"POST\" ENCTYPE=\"multipart/form-data\">";
echo "[b]File to be sent :[/b]
";
echo "<input type=\"file\" name=\"superdat\"/>";
echo "<input type=\"hidden\" name=\"upload\" value=\"upload\"/>
";
echo "<input type=\"submit\" name=\"submit\" value=\"Upload File\"/>";
echo "</form>";
echo "
<a href=\"index.php?action=ugal&ses=$ses\">$gallery_simg Gallery</a>
";
echo "<a href=\"index.php?action=main&ses=$ses\">$home_simg Home</a>";
echo "</p>";
echo webfoot();
}
}