Hi, I’m trying to upload a song to a directory of my choice, and i found out how to upload an image and it worked by php code..i used the same code to do the same for songs, (upload songs) and it kinda freaked out and started giving me errors that don’t make sense..like the categoryID index doesnt exist but it does coz i posted it in an <input> tag inside a form whose action is the page thas supposed to upload the song..i used the same code to upload songs and images assuming that both are treated as files..it worked on images but not on songs..so if anyone could help me out i wud appreciate it..maybe songs have different php code to upload different from images..
$category=$_POST[‘categoryID’];
$name=$
$cat = $_POST[‘category’];
$singer = $
$dir = $_FILES[‘directory’];
$target_path = “../../extras/music/”.$cat.”/”;
//echo $target_path;
$target_path = $target_path . basename($_FILES[‘directory’][‘name’]);
if(move_uploaded_file($
echo ‘<script>alert(“The Song has been uploaded”);</script>’;
else
echo ‘<script>alert(“problem!”);</script>’;
$song= $cat.”/”.basename( $_FILES[‘directory’][‘name’]);
//echo $song;*/
//if($song == ($cat.”/”)){
/
echo ‘<script>location.href(“../index.php?addSong”);</script>’;