knowram Posted January 18, 2009 Share Posted January 18, 2009 I am trying to figure out how to add an image uploading script to my site so that people can add a profile image. I have been searching for 3 days now and I must be looking in the wrong places. I am not sure which is best, to store the image in a mysql database or in a directory? Can someone point me in the right direction please? Thank you for all the help. Quote Link to comment https://forums.phpfreaks.com/topic/141288-solved-image-uploading/ Share on other sites More sharing options...
RussellReal Posted January 18, 2009 Share Posted January 18, 2009 w3schools.com look in php for uploads EDIT:: I did it for you http://w3schools.com/php/php_file_upload.asp Quote Link to comment https://forums.phpfreaks.com/topic/141288-solved-image-uploading/#findComment-739508 Share on other sites More sharing options...
saradrungta Posted January 18, 2009 Share Posted January 18, 2009 try this <?php if(isset($_POST['submit'])){ $folder="uploaded_files/"; $userfile=$_FILES['ufile']['tmp_name']; $filename=basename($_FILES['ufile']['name']); $serverpath="$folder$filename"; $x=move_uploaded_file($userfile,$serverpath); if($x){ echo "File Uploaded Sucessfully"; } else{ echo "file not uploaded"; } } ?> <html> <body> <form enctype="multipart/form-data" method=post> file<input type=file name=ufile><input type=submit name=submit value=UPLOAD> </form> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/141288-solved-image-uploading/#findComment-739512 Share on other sites More sharing options...
knowram Posted January 18, 2009 Author Share Posted January 18, 2009 Thanks for the help I will give it a shot. Quote Link to comment https://forums.phpfreaks.com/topic/141288-solved-image-uploading/#findComment-739513 Share on other sites More sharing options...
knowram Posted January 18, 2009 Author Share Posted January 18, 2009 any ideas for a php script to create a thumbnail of the image being uploaded? Quote Link to comment https://forums.phpfreaks.com/topic/141288-solved-image-uploading/#findComment-739569 Share on other sites More sharing options...
RussellReal Posted January 18, 2009 Share Posted January 18, 2009 imagecopyresampled Quote Link to comment https://forums.phpfreaks.com/topic/141288-solved-image-uploading/#findComment-739582 Share on other sites More sharing options...
knowram Posted January 18, 2009 Author Share Posted January 18, 2009 I think I found what I need. Thanks for the help everyone Quote Link to comment https://forums.phpfreaks.com/topic/141288-solved-image-uploading/#findComment-739585 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.