Jump to content

Profile Pictures


supermerc

Recommended Posts

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
Share on other sites

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 initially
The file is given a temporary name initially
The file (temp file) should then be 'moved' to its permanent location
The original file name is stored in the database field
The 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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.