Hi, I need some help to you, i want to know how can i do this,when after the user login.I want that to put picture besides his name just like the same in the facebook after we login..can you help me please how can i do this.

example:

Welcome <img> jemz.

Thank you in advance.

Sheegoth
—
2012-11-13T23:57:23Z —
#2

Hello there.

Where exactly do you want this image to be displayed?Facebook displays the user's image beside their name in the top-most bar (next to navigation).Are you trying to do the same?

jemz
—
2012-11-14T06:56:33Z —
#3

Sheegoth said:

Hello there.

Where exactly do you want this image to be displayed?Facebook displays the user's image beside their name in the top-most bar (next to navigation).Are you trying to do the same?

Yes, just like that.can you help me please i have no idea on this.I hope you can help me.thank you in advance.

SpikeZ
—
2012-11-14T09:45:00Z —
#4

ok so you need a few things in place before this will happen.

1/ give the user an upload form so they can upload their image.2/ resize the image to fit with your dimensions 3/ store the filename in the database table along with the other user information.4/ query the database to get all the user info including the image name.5/ add the image tag to the users profile and display the image that is stored on your server.

or

use gravatar.....

Cups
—
2012-11-14T09:55:55Z —
#5

Make sure every login is unique, and to make is easier make sure each login only contains characters which are allowed in a valid file name.

This is just an incredibly simplified example of how you could go about things ie username === image name plus .jpg, but you have to be very very careful to defend against simple attacks - as my comments hopefully show, I have no idea how clean or "tamper-able" the data getting to your SESSION is.

tentim
—
2012-11-14T10:45:04Z —
#6

Let users upload their pics, save the path to the pics in db column, say, image_column

................................................................................................Then in the member area:

$path_to_image = $SESSION['pathto_image']

echo "<img src='$path_to_image'>" anywhere you want the image to appear.

Note these are just code ideas, not actual code.

jemz
—
2012-11-14T12:39:23Z —
#7

@spikeZ,@Cups,@tentim...Thank you for giving this idea.okay i will try to make a simple upload form...but i have question what if the uploaded picture is 500x400 and then how can i resize this to display it to 23px or just the same the size in the facebook...Thank you in advance.

SpikeZ
—
2012-11-14T12:57:53Z —
#8

Have a look for a simple upload and resize script jemz. There are plenty around and they will upload the picture to your server and then resize it to the width/height you tell them.Whatever you do DO NOT upload a 500px wide picture and then use the browser to squash it down to 23px!!!!