Php Image

buharyahmad59

New Member
Messages
1
Reaction score
0
Points
0
I want to use an image in a page using php/mysql. I wanted to use a default image just like what takes place in facebook. The image will be by default to all users and when a user uploads an image will view the image he uploads.
can someone help me build something like this using php/mysq
Thanks
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
I'm confused as to what you mean, and I suspect by the lack of replies that other people are, too. Could you explain again, in more detail and a bit clearer, please?

~Callum
 
Last edited:

atlanis

New Member
Messages
24
Reaction score
0
Points
0
I think he means something like this:

User A registers.
User A gets default avatar.
User A uploads new avatar.
User A displays new avatar.

User B registers.
User B gets default avatar.
User B displays default avatar.

Maybe?

Anyway, you can do a check to see if the custom avatar exists. Something like:
Code:
$avatar_url = '/path/to/avatar.png';
while($row = mysql_fetch_assoc($result))
{
    if($row['avatar'] != 'default')
        $avatar_url = $row['avatar'];
}

In the DB, `avatar` should be a VARCHAR long enough for your paths that defaults to 'default'.

If you need help with uploads, see this: http://tinyurl.com/n9ekn4
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
Nah, not like that.

In the table for the user, have an 'image' field. When they first register, set it to blank.png, and in images/avatars/, have blank.jpg. Then when they upload new images, save it in images/avatars/ and update their entry in the database so that it points at the new image.

Do you know how to upload images using php?

~Callum
 

kauranamoda

New Member
Messages
4
Reaction score
0
Points
0
yah, this is exactly want i needed. pls can you provide more detail on how to do this including the pages to creat in a simplest form?
and i dont know how to upload image using php. think that will help
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
You want me to do it for you?! Nahh.

I'll tell you HOW to do it, but I won't do it for you. You won't learn if you expect everyone else to do it for you ;)

First off, what are you actually trying to do? I could do with more information if I'm going to help you.

~Callum
 

kauranamoda

New Member
Messages
4
Reaction score
0
Points
0
I said all i could. I need a tutorial that will guide me on how to create the image uploader and how it works. Simple i dont need it to be done for me as i wont be competent enough to come up with good applications

Thanks
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
What context do you need it in? Are you making an image uploader, a display picture thing, or what?

~Callum
 

kauranamoda

New Member
Messages
4
Reaction score
0
Points
0
Yes! I am making an image uploader which will be used first then a display picture which will be after uploading the image.

Thanks once more
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
This kind of script is against the ToS, are you hosting it on x10hosting?

~Callum
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
This kind of script is against the ToS, are you hosting it on x10hosting?

~Callum

If he is using it to enable forum members to upload avatars to be displayed on his forum, is it against the TOS?
 
Top