...

View Full Version : PHP image questions



markman641
01-22-2012, 07:32 AM
Alright so I googled up how to make a PHP image is this is what I got:

http://www.money4every1.net/customimage.php

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:

<img src="http://fsprizes.com/images/signature/2_Money4Every1.gif" width="468" height="60" border="0" /></a>

So how would I do this?

bacterozoid
01-22-2012, 12:28 PM
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.

markman641
01-22-2012, 07:04 PM
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.

bacterozoid
01-22-2012, 07:11 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum