PDA

View Full Version : PHP in sig


DarkStreetDev
09-09-2003, 01:57 PM
Hi, I saw a member of this forum has PHP in his sig (which retrieves a random quote from a text file). Is this possible to do (well, obviously it is, :) )? If yes, how?

n8thegreat
09-09-2003, 06:25 PM
its an image, he has the script on a server, and it uses GD to generate an image

DarkStreetDev
09-13-2003, 05:40 AM
Hey, I got the code (http://www.paintbug.com/scripts/quote_source.phps) but how do u set it up? I'll upload the script to my server, but what then?

scoutt
09-13-2003, 09:23 AM
just take that source and put it in a file and then call that file in your sig.

http://www.yoursite.com/quote.php

and then stick on the end of that above.

DarkStreetDev
09-14-2003, 06:50 AM
Ok then, thanks, scoutt, I'll try that right now.

Dudex
09-14-2003, 01:31 PM
don't forget the .htaccess ;)

O, and the source code I learned from (the other one looks complicated lol) can be found in this post.

http://www.htmlforums.com/showthread.php?threadid=28446&perpage=15&pagenumber=1

scoutt
09-14-2003, 02:16 PM
you don't need the htaccess if done correctly.

Dudex
09-14-2003, 09:46 PM
Isn't the .htaccess there to redirect the .jpg image to the .php page so when you do the [img] thing, you can put the .jpg since the [img] doesn't allow .php?

scoutt
09-14-2003, 11:01 PM
no, if the php page is echoing a image then you don't have to. that is what the [img] tag is for, it makes it an image. if you were loadiong a jpg and wanted that jpg to run as php then you would need the .htaccess file.

I ran a php in an [img] tag before, no probs. it just hogs system resources as every post in a thread will access the server the php page is on, take a lot of bandwidth after awhile.

Uranium-235
09-16-2003, 04:00 AM
jeez I'm so freakn cool all of the sudden :rolleyes:

I'm using mod-rewrite (inside a htaccess file) to allow me to pass the textcolor into the script by changing the name of the image. It used to be the background color too, but then I realized that IE dosen't support PNG Alpha transperancy, but it does support just plain PNG transperancy, so I just made the bg transperant.

Anyways, this is the rule that I used. If you want to, you can just modify the source to pass in your own text color.

Oh and the phps isn't the full source. There's code in there I Use to track the HTTP refer of the websites that use the image. Just in-case anyone tries to use it without my permission (and they have before).

You also need a quotefile (quotes.txt). Mine has over 10,000 quotes, you make your own.


RewriteRule ^scripts/quote-(.*)-(.*)\.png /scripts/rndquote11/?bgcolor=$1&textcolor=$2