supermerc Posted December 18, 2006 Share Posted December 18, 2006 Hey, does anyone know a good tutorial on how to make it so that users can add a picture to their profile?I try googling it but i dont think im googling the right words because its not giving me anything good. Link to comment https://forums.phpfreaks.com/topic/31173-profile-pictures/ Share on other sites More sharing options...
trq Posted December 18, 2006 Share Posted December 18, 2006 Heres where a little bit of thought comes in handy. Why not google for a tutorial on uploading images, saving there paths to a database field. Then its just a metter of pulling out that path allong with the rest of your users profile data and BOOM! Profiles with images. Link to comment https://forums.phpfreaks.com/topic/31173-profile-pictures/#findComment-144055 Share on other sites More sharing options...
supermerc Posted December 19, 2006 Author Share Posted December 19, 2006 Is there a way to save it to the database thought? It would be easier for me to make it show in their profile. Link to comment https://forums.phpfreaks.com/topic/31173-profile-pictures/#findComment-144090 Share on other sites More sharing options...
simcoweb Posted December 19, 2006 Share Posted December 19, 2006 It's not easier to show a pic by it being 'in a database'. Basically what you store 'in the database' is just the image name or the path and the name. There's loads of good tutorials and plenty of code snippets for image/file uploading. Once you understand what happens during the upload then it becomes much easier.The file is uploaded to a temporary directory initiallyThe file is given a temporary name initiallyThe file (temp file) should then be 'moved' to its permanent locationThe original file name is stored in the database fieldThe file is called to your profile page by using the standard <img src= > tag<img src="http://www.yoursite.com/imagefolder/$image_variable_or_similar" width="400" height="300">Or, if in a while loop example: while ($row = mysql_fetch_array($mysqlquery){echo "<img src='http://www.yoursite.com/imagefolder/" . $row['photo'] . "' width='400' height='300'>";} Link to comment https://forums.phpfreaks.com/topic/31173-profile-pictures/#findComment-144096 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.