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 Link to comment https://forums.phpfreaks.com/topic/148057-upload-problem/ 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'] Link to comment https://forums.phpfreaks.com/topic/148057-upload-problem/#findComment-777118 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 Link to comment https://forums.phpfreaks.com/topic/148057-upload-problem/#findComment-777123 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 Link to comment https://forums.phpfreaks.com/topic/148057-upload-problem/#findComment-777124 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.