lalnfl Posted October 7, 2010 Share Posted October 7, 2010 This doesn't seem to be working. Any help? if (isset ($_POST['edit_poser'])){ $errormsg = ""; if (!$_FILES['userfile']['tmp_name']){ $errormsg = "<font style='color: #ff0000;'>Select an Image</font>"; } else { $maxfilesize = 51200; if ($_FILES['userfile']['size'] > $maxfilesize){ $errormsg = "<font style='color: #ff0000;'>Image is too large, select a smaller one</font>"; unlink($_FILES['userfile']['tmp_name']); } else if (!preg_match("/\.(gif|jpg|png)$/i" , $_FILES['userfile']['name'])){ $errormsg = "<font style='color: #ff0000;'>Image needs to be gif, jpg, or png</font>"; unlink($_FILES['userfile']['tmp_name']); } else { $newname = "image01.jpg"; $place_file = move_uploaded_file($_FILES['userfile']['tmp_name'], "Members/$id/".$newname); $errormsg = "<font style='color: #ff0000;'>Your image has successfully been updated</font>"; } } } // ends first if statement Quote Link to comment Share on other sites More sharing options...
lalnfl Posted October 7, 2010 Author Share Posted October 7, 2010 It goes through everything correctly it just doesn't place the image into the directory. What am I doing wrong? Quote Link to comment Share on other sites More sharing options...
chintansshah Posted October 7, 2010 Share Posted October 7, 2010 is the "Members/$id/".$newname $id folder is available on server? If not then create it first and give 777 permission to upload files. Quote Link to comment Share on other sites More sharing options...
phpchamps Posted October 7, 2010 Share Posted October 7, 2010 why 777??? write permission to others also ????? give 775 or 755 ..... 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.