+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Php Image

  1. #1
    buharyahmad59 is offline x10Hosting Member buharyahmad59 is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    1

    Php Image

    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

  2. #2
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    Re: Php Image

    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 by callumacrae; 01-03-2011 at 04:43 AM. Reason: typo
    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

  3. #3
    atlanis is offline x10Hosting Member atlanis is an unknown quantity at this point
    Join Date
    Mar 2010
    Posts
    24

    Re: Php Image

    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

  4. #4
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    Re: Php Image

    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
    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

  5. #5
    kauranamoda is offline x10Hosting Member kauranamoda is an unknown quantity at this point
    Join Date
    Jun 2010
    Posts
    4

    Re: Php Image

    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

  6. #6
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    Re: Php Image

    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
    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

  7. #7
    kauranamoda is offline x10Hosting Member kauranamoda is an unknown quantity at this point
    Join Date
    Jun 2010
    Posts
    4

    Re: Php Image

    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

  8. #8
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    Re: Php Image

    What context do you need it in? Are you making an image uploader, a display picture thing, or what?

    ~Callum
    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

  9. #9
    kauranamoda is offline x10Hosting Member kauranamoda is an unknown quantity at this point
    Join Date
    Jun 2010
    Posts
    4

    Re: Php Image

    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

  10. #10
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    Re: Php Image

    This kind of script is against the ToS, are you hosting it on x10hosting?

    ~Callum
    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Big Image Small Image.
    By Parsa44 in forum Graphics & Webdesign
    Replies: 4
    Last Post: 03-09-2009, 02:40 AM
  2. Image Help.
    By Mike3854 in forum Free Hosting
    Replies: 9
    Last Post: 02-12-2008, 09:18 AM
  3. plz fix this image!
    By galaxyAbstractor in forum The Marketplace
    Replies: 19
    Last Post: 10-31-2007, 06:01 AM
  4. IE7 Image
    By crazywhite1989 in forum Feedback and Suggestions
    Replies: 2
    Last Post: 07-02-2007, 08:08 AM
  5. PHP Image
    By Brandon in forum Off Topic
    Replies: 8
    Last Post: 01-14-2006, 09:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers