Jump to content
xisto Community
elrohir

Making A Sig With Php just wondering how it works

Recommended Posts

I was just wondering how to make an image that uses stuff given to it by php, yet remains only an image - say I want the site's title in an image. I believe it has something to do with putting an index.php inside a folder called image.png or whatever. Am I right?thanks

Share this post


Link to post
Share on other sites

This depends. PHP can generate any image it likes on the fly and create a PNG, GIF or JPG file. The reason a folder called something.png is required is becuase forums do not allow you to put PHP files as an image in your sig, so they can be made to believe that the folder is actually an image and they still see the output of index.php within that folder. Try looking in the tutorials sections here at Xisto, especially the graphics section, and you will see many tutorials on making PHP signatures.

Share this post


Link to post
Share on other sites

You can link to a PHP file as an image (eg. site.com/image.php), and the browser will treat it as an image provided the script sends it the correct header specifying the type of file it is - such as header('Content-Type: image/gif'). If your host supports it - which I belive Xisto does, although I may be wrong (I don't have hosting here) - you can force a certain file to be treated as an image by way of a .htaccess file:

<Files image.gif>ForceType application/x-httpd-php</Files>

Thus, the file image.gif is in actual fact a PHP script, even though it has a .gif extension. Placing the index.php script in a folder called 'image.extension' may work, and it is mentioned in most of the dynamic signature tutorials I've seen on Xisto, but it is a little 'hackish' and certainly not the way to go if you can avoid it.

Share this post


Link to post
Share on other sites

This is one way of doing it and i think its the way that many of the dynamic sigs here work. The image is a link to a php script that simply writes some text onto an image background and sends it to the browser as an image.

http://forums.xisto.com/no_longer_exists/

That site is all about the gd image library which you will need to install. Depending on what system you are using it might already be installed. To check just use phpinfo(); and check on the GD library area to see if its installed.

If not that link has another link where you can find the GD library.

Once installed and if you have read through that link above you should be able to take the first steps into image manipulation using PHP. Its not too difficult once youve practiced. Start by writing text onto a background and move on from there :)

Notice from jlhaslip:
Edit to remove faulty bbcode

Share this post


Link to post
Share on other sites

It's like using the GD library to create an image like for an info image that displays your browser, IP, time, date and hits. The only problem is that not all hosts support it or even have it and I haven't tried it on trap's servers yet.

Share this post


Link to post
Share on other sites

Well i made one whole site for users who could enter their own text and then it shows a random image with a random text entered by the user.
I use around 23 images in random.

Also a very powerful tool in Apace is mod_rewrite rule that can show something like http://forums.xisto.com/index.php?image=electron to:
http://forums.xisto.com/no_longer_exists/

Thats one cool stuff i loved to play with.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.