heres a handy upload script that i use was based off the TTuplaoder i think that what it was called lol
Code:
echo "[u][i][b]Upload[/b][/i][/u]
";
echo "<p align=\"center\">
Image Files
\n";
$size_bytes=2048000;
$kb=$size_bytes/1024;
$mb=$kb/1024;
echo "Max [b]$mb[/b] Mb
<img src=\"../images/point.gif\" alt=\"!\"/>You can email ur pic to
[b]afta_drk@hotmail.com[/b]
wif ur username attached or use the below uploader
</p>
<div class=\"center\">
<form method=\"post\" enctype=\"multipart/form-data\" action=\"./upload.php?upload=yes&sid=$sid\">
<input type=\"file\" name=\"filetoupload\"/>
<input type=\"submit\" name=\"uploadform\" value=\"Upload\"/>
</form>
</div>
<p align=\"center\">\n";
$extlimit="yes";
$limitedext=array(".jpg",".jpeg",".gif",".png");
$ext=strtolower(strrchr($_FILES['filetoupload'][name],'.'));
$file_type=$_FILES['filetoupload']['type'];
$file_name=$_FILES['filetoupload']['name'];
$file_size=$_FILES['filetoupload']['size'];
$file_tmp=$_FILES['filetoupload']['tmp_name'];
if($upload=="yes"){
if(!is_uploaded_file($_FILES['filetoupload']['tmp_name'])){
echo "<img src=\"../images/error.gif\" alt=\"[x]\"/>No file selected!
<a href=\"./gallery.php?sid=$sid\">Gallery Pics</a>\n";
}
else if($extlimit=="yes" && !in_array($ext,$limitedext)){
echo "<img src=\"../images/error.gif\" alt=\"[x]\"/>Invalid file type!
<a href=\"./gallery.php?sid=$sid\">Gallery Pics</a>\n";
}
else if($file_size>$size_bytes){
echo "<img src=\"../images/error.gif\" alt=\"[x]\"/>Exceeded File size limit! Maximum [b]$kb[/b] Kb.
<a href=\"./gallery.php?sid=$sid\">Gallery Pics</a>\n";
}
else if(file_exists("./$file_name")){
echo "<img src=\"../images/error.gif\" alt=\"[x]\"/>Filename already exists!
<a href=\"./gallery.php?sid=$sid\">Gallery Pics</a>\n";
}
else if(file_exists("./".getnick_sid($sid)."(5)".$ext)){
echo "<img src=\"../images/error.gif\" alt=\"[x]\"/>
[b]Error!!![/b]
5 pics hav already been uploaded...
<a href=\"./gallery.php?sid=$sid\">Gallery Pics</a>\n";
}
else if($file_size){
if(!file_exists("./".getnick_sid($sid)."(1)".$ext)){$pic=getnick_sid($sid)."(1)".$ext;}
if(file_exists("./$pic")){$pic=getnick_sid($sid)."(2)".$ext;}
if(file_exists("./$pic")){$pic=getnick_sid($sid)."(3)".$ext;}
if(file_exists("./$pic")){$pic=getnick_sid($sid)."(4)".$ext;}
if(file_exists("./$pic")){$pic=getnick_sid($sid)."(5)".$ext;}
move_uploaded_file($file_tmp, "./$pic");
echo "
<img src=\"../phpThumb/phpThumb.php?src=../gallery/$pic&w=150\" alt=\"$pic\"/>
<img src=\"../images/ok.gif\" alt=\":o)\"/>
$file_name
sucessfully uploaded!
<a href=\"./gallery.php?sid=$sid\">Gallery Pics</a>\n";
}
else{
echo "<img src=\"../images/error.gif\" alt=\"[x]\"/>Unknown error! Pls try again...
<a href=\"./gallery.php?sid=$sid\">Gallery Pics</a>\n";
}
}
echo "</p>
<p align=\"center\">
<a href=\"../inbox/inbox.php?sid=$sid\">Inbox</a>
<a href=\"../buds/buds.php?sid=$sid\">BuddyList</a>
<a href=\"../chat/public.php?sid=$sid\">Chat</a>
<a href=\"../forums/forums.php?sid=$sid\">Forums</a>
<a href=\"../main.php?sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>
</p>";
Comment