+ 3

how can I upload an image and display it as profile pics in my profile management page of my website

Hey guys I'm trying to add a profile picture to a page in my website. If a pics is uploaded to a folder called images how can I echo out that particular picture the user uploaded and use it as the profile image all throughout the page. And a way to change them if the user want a different photo. Please any help would be appreciated thanks.

3rd Mar 2018, 5:05 PM
Franklyn Omeben
Franklyn Omeben - avatar
1 ответ
0
Let's imagine you have database. In this database, you save informations about the users and one of the information is the path to the profil pic of the user. One you detected wich user's profile must be displayied, you can save the path to the picture in a variable called... picPath? Then with echo, you can write the path of the pic in the sec attribute, like this for example: <?php echo "<img src='".$picPath."'/>" ?> (It's ben a while since I didn't write any PHP code, but I think the one I just wrote is correct)
11th Mar 2018, 12:10 AM
Nobody