View Single Post
  #11 (permalink)  
Old 11-12-2007, 07:01 PM
raptor5099 raptor5099 is offline
Novice
Join Date: Oct 2007
Posts: 25
iTrader: (0)
raptor5099 is on a distinguished road
Code:
 if (!($uploaded_type=="audio/mp3")) {
 echo "You may only upload MP3 files.<br>";
 $ok=0;
 }
^well doesnt this mean if you try to upload anything but mp3 it will return an error


and this is the upload part of my form

Code:
<?php
$target = "upload";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if ($uploaded_size > 7000000)
{
echo "Your file is too large.<br>";
$ok=0;
}
if($imageinfo['mime']!='audio/mp3'){
echo "We only accept mp3 music fies.";
$ok=o;
}    
if ($uploaded_type =="text/php")
{
echo "No PHP files<br>";
$ok=0; 
}

if ($ok==0)
{
Echo "";
} 

{
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else {
echo "Sorry, there was a problem uploading your file.";
}
}
?>

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote