garydt Posted July 29, 2007 Share Posted July 29, 2007 I have a website that lets users upload jpeg files. Some users upload fine but when others try they get a page full of warnings and lose the site. What would cause this? Also, now when users are logging in they are logging into other users accounts but it was working fine 2 days ago. I haven't changed the script so why is this happening? Thanks. Quote Link to comment Share on other sites More sharing options...
garydt Posted July 29, 2007 Author Share Posted July 29, 2007 shall I post the uploading file script? Quote Link to comment Share on other sites More sharing options...
garydt Posted July 29, 2007 Author Share Posted July 29, 2007 I've worked out the log in problem but still can't why some users are able to upload photos but others can't. Heres the upload script- <form name="form1" id="Upload" action="<?php echo $editFormAction; ?>" enctype="multipart/form-data" method="POST"> <p> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size ?>"> </p> <h3> <input name="file" type="file" id="file" onchange="MM_showHideLayers('Layer1','','hide')" /> <span class="style1">for your photo</span> </h3> <p> <label> <input name="sent" type="hidden" id="sent" value="1" /> </label> </p> <input type="hidden" name="MM_insert" value="form1"> </form> $editFormAction = ''; $max_file_size = 1024*1024*1024; //1MB if(isset($_POST['sent'])){ unset($submit); if (isset($_POST['sent'])) $submit = true; else die('Error: No file got sent'); $uploadsDirectory = './uploads/'; //Upload image $uploadFilename = $uploadsDirectory.$fieldname['name']; // now let's move the file to its final location and allocate the new filename to it move_uploaded_file($fieldname['tmp_name'], $uploadFilename); $user = ($_SESSION['MM_Username']); $a = rand(0,9999); resizeimage($fieldname['name']); rename("thumbnails/".$fieldname['name'], "thumbnails/".$user.$a.$fieldname['name']); $smallimage = './thumbnails/'.$user.$a.$_FILES['file']['name']; resizelarger($fieldname['name']); rename("smallpics/".$fieldname['name'], "smallpics/".$user.$a.$fieldname['name']); $smallpics = './smallpics/'.$user.$a.$_FILES['file']['name']; unlink($uploadFilename); Any ideas? 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.