php /displaying pictures form database depending on users

74 views
asked Feb 9, 2013 in General by A007 (360 points)
Hello

In my pho page, I have a table with registered users pictures that is accessible only by logged in users. I want to output the picture of the specific user that is logged in on the user’s front end home page. How can I do that? Can anyone please help?
Any suggestions would be highly appreciated
Thanks

1 Answer

0 like 0 dislike
answered Feb 9, 2013 by SmartHost (9,060 points)
You need to store all your pictures in a directory, and name the images as the username.jpg. The in your table column, such as "prof_pic", set the image's file name. Then you need to create a way to relate the picture ID with the login_name. So now when the user logs in, make a function that looks for the username.jpg  and displays it and if it’s not found then nothing loads.
...