security-vb
New Member
I am making a website for users to be able to track their favorite bands. One of the features of the website is allowing users to upload pictures of any gigs they have been to, they are then saved to a file and image location is stored in the database. My problem is I need to be able to resize the images upon saving, as the page is taking to long to load when there are many pictures.I know there are many questions on here like this but i'm just not to sure how to modify the code I have to do this.Is this the best way to do it or should I use thumbnails? as the images are going to be displayed in a gallery, if there is many then the page is going to load slowerMy knowledge of php is limited so any help is appreciatedThis is the code I have at the moment:\[code\] <?php ///UPLOAD IMAGES $sql = "SELECT * FROM photouploads WHERE BandID ='$bandid'"; $result = mysql_query($sql,$connect)or die ($error1); $row = mysql_num_rows($result); $userid=$_SESSION['userid']; if (isset($_POST['submit'])) { $name = $bandid."(".++$row.").jpg"; $tmp_name=$_FILES['photo']['tmp_name']; if ($name) { //start upload $location="Photouploads/".$name; if (move_uploaded_file($tmp_name,$location)) { mysql_query("INSERT INTO photouploads (BandID,UserID,ImageLocation) VALUES ('$bandid', '$userid', '$location')") ; } }else;}\[/code\]And my form: \[code\] <input type='file' name='photo' id='photo'> <input type='submit' class='submitLink' name='submit' id='submit'value='http://stackoverflow.com/questions/15761335/upload'> </form>";?>\[/code\]