Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2011
    Posts
    272
    Thanks
    63
    Thanked 1 Time in 1 Post

    PHP image questions

    Alright so I googled up how to make a PHP image is this is what I got:



    Now here is the REAL question. How would I go about making one that customizes to every user in my website?

    Like I want to make a html code to give to my users like this:
    Code:
    <img src="http://fsprizes.com/images/signature/2_Money4Every1.gif" width="468" height="60" border="0" /></a>
    So how would I do this?

  • #2
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    It looks like you've got the GD library figured out. It should be pretty easy to take this to the next step.

    Your first option is to just generate images for every user once a day (or however often you want) and store them on your server, then give users images like:

    http://fsprizes.com/images/signature/image-[enter user id here].gif

    The better way would be to use a PHP page that generates a 100% up to date image every time, like this:

    http://fsprizes.com/images/signature/image.php?user_id=[enter user id here]

    In order to do that, you create the PHP page with all of your image generation code. Look at $_GET['user_id'] to figure out which user to generate the image for. Then use headers in PHP and a web browser will treat the PHP page just like an image.

    Keep in mind that a lot of forums don't allow you to use images with a .php file extension. There are other ways around that, but it gets somewhat tricky.

    See if that gets you started. You may have some questions about how to do one of the above options, so please ask if you do. I just wanted to give you the high level overview first.

  • Users who have thanked bacterozoid for this post:

    markman641 (01-22-2012)

  • #3
    Regular Coder
    Join Date
    Jul 2011
    Posts
    272
    Thanks
    63
    Thanked 1 Time in 1 Post
    Thanks! I didn't realize you could use GET for the image!

    Now what were you saying about
    Keep in mind that a lot of forums don't allow you to use images with a .php file extension. There are other ways around that, but it gets somewhat tricky.

  • #4
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    It's easy to use a PHP file with the right headers to make a web browser treat it like an image. However, a lot of forum software will prevent images from loading if they have a .php or other non-standard extension.

    I'm not too familiar with the process, so I can't give you any details on how to do it, but you can set up your web server to execute files with image extensions as PHP. I'm not sure what other problems that creates, so you may just need to do some googling or get some additional help on a forum.

  • Users who have thanked bacterozoid for this post:

    markman641 (01-24-2012)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •