ayok Posted September 8, 2008 Share Posted September 8, 2008 Hi, I have a problem with my upload script, the move_uploaded_file doesn't work. It works on other server, but in this server, where I work on now, it's just return false with no error message. Could anybody tell me what's wrong? thanks, ayok Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted September 8, 2008 Share Posted September 8, 2008 At the top put: ini_set("error_reporting","1"); error_reporting(E_ALL); Then see if any errors are outputted. Quote Link to comment Share on other sites More sharing options...
aschk Posted September 8, 2008 Share Posted September 8, 2008 If you post some code we may be able to further assist in this matter... Quote Link to comment Share on other sites More sharing options...
ayok Posted September 8, 2008 Author Share Posted September 8, 2008 Hi thanks, Here is the code for the upload page: <? echo "<table width=500 align=center>"; echo"<form enctype='multipart/form-data' action='newpics.php' method='POST'>"; for($i=0;$i<5;$i++){ $no=$i+1; echo "<tr><td>Foto $no:</td><td> <input type='FILE' name='fupload[]'></td></tr>"; } echo "<tr><td><INPUT TYPE=submit value=Uplot></td></tr>"; echo "</form></table>"; } ?> And this is newpics.php <? $fupload = $_FILES['fupload']['tmp_name']; $fupload_name = $_FILES['fupload']['name']; $fupload_type = $_FILES['fupload']['type']; $jml_file=count($fupload); $i=0; while($i < $jml_file){ $direktori_file = "../../writable/products/$fupload_name[$i]"; move_uploaded_file($fupload[$i],"$direktori_file"); $i++; } header("location:index.php"); ?> move_uploaded_file doesn't work. It just goes to index.php with no uploaded image. But, this script are working on my localhost. ayok Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted September 9, 2008 Share Posted September 9, 2008 Don't use short-tags, they may not be enabled on your server. Use <?php instead of <? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.