Jump to content

Profile Pictures


supermerc

Recommended Posts

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
https://forums.phpfreaks.com/topic/31173-profile-pictures/#findComment-144096
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.