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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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'>";} 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.