At 5/30/09 08:56 PM, Glaiel-Gamer wrote: I have a URL swful.com and I want to pop the uploader code on that so the site doesnt feel like such a waste of money
<?php
$width = $_POST["wid"];
$height = $_POST["hei"];
if(!empty($_FILES['uploadfile']) && $_FILES['uploadfile']['error']==0){
$filename = $_FILES['uploadfile']['name'];
$ft = substr($filename, strpos($filename, ".")+1);
if($ft=="swf"){
if($_FILES['uploadfile']['size']<10485760){
$uploadto = "files/".substr($filename, 0, strpos($filename, ".")).rand(1, 999999).".";
if(move_uploaded_file($_FILES['uploadfile']['tmp_name'], $uploadto.$ft)){
echo "File uploaded! <a href='".$uploadto.$ft."'>Direct link</a>";
} else {
echo "Error! Sorry, file could not be uploaded. ";
}
} else {
echo "Error! File size too big.";
}
} else {
echo "Error! Wrong file size.";
}
} else {
echo "Error! File was empty or there was an error trying to upload.";
}
?>
That's pretty much mine. It's quite simple o_รณ for a.. shit one anyway :)
Sup, bitches :)