here is my code that is supposed to upload files and save it to web server but somehow didn't work. Please help. I'm new in php and I'm using version 4
$thumb_loc = "../Folders/".$myfolder ."/";
$thumb_loc = $thumb_loc.base name($myfile);
if (!file_exists($ thumb_loc)){
if (move_uploaded_ file($myfile,$t humb_loc)){
echo "<script language='javas cript'> location.href=' default.php?mes sage=File uploaded&method =list';</script>";
}
else{
echo "<script language='javas cript'> location.href=' default.php?mes sage=Uploading failed&method=l ist';</script>";
}
}
else{
echo "<script language='javas cript'> location.href=' default.php?mes sage=File already exists&method=l ist';</script>";
}
$thumb_loc = "../Folders/".$myfolder ."/";
$thumb_loc = $thumb_loc.base name($myfile);
if (!file_exists($ thumb_loc)){
if (move_uploaded_ file($myfile,$t humb_loc)){
echo "<script language='javas cript'> location.href=' default.php?mes sage=File uploaded&method =list';</script>";
}
else{
echo "<script language='javas cript'> location.href=' default.php?mes sage=Uploading failed&method=l ist';</script>";
}
}
else{
echo "<script language='javas cript'> location.href=' default.php?mes sage=File already exists&method=l ist';</script>";
}
Comment