sungpeng Posted March 5, 2009 Share Posted March 5, 2009 <?php include 'config.php'; if($_POST[action]=="Update") { $folder_path="instant/"; $image_path=$folder_path.$_FILES['imagefile']['name']; $img_name=$_FILES['imagefile']['name']; copy($imagefile, "$image_path"); } ?> <html> <title>Upload an image to a database</title> <body> <h2>Update with new information</h2> <form name="form" enctype="multipart/form-data" method="post" action="<?php echo"$PHP_SELF?pid=$_GET[pid]"; ?>"> <input type='file' name='imagefile'><br> <input type="submit" name="action" value="Update"> </form> </body> </html> Hi good day check is there error in my code? Why I cannot upload anything picture using this code. Thank Quote Link to comment Share on other sites More sharing options...
jackpf Posted March 5, 2009 Share Posted March 5, 2009 What sort of error are you getting? And what's up with that weird character after the { ? Your PHP_SELF doesn't look quite right either, it should be $_SERVER['PHP_SELF'] Quote Link to comment Share on other sites More sharing options...
sungpeng Posted March 5, 2009 Author Share Posted March 5, 2009 This code work on readyspace.com.sg but it doesn't work on hostmonster.com Quote Link to comment Share on other sites More sharing options...
sungpeng Posted March 5, 2009 Author Share Posted March 5, 2009 it doesn't upload the picture into the folder "instant" which is set to 777 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.