PHP in sig<

liunx

Guest
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?its an image, he has the script on a server, and it uses GD to generate an imageHey, I got the code (<!-- m --><a class="postlink" href="http://www.paintbug.com/scripts/quote_source.phps">http://www.paintbug.com/scripts/quote_source.phps</a><!-- m -->) but how do u set it up? I'll upload the script to my server, but what then?just take that source and put it in a file and then call that file in your sig.

<!-- m --><a class="postlink" href="http://www.yoursite.com/quote.php">http://www.yoursite.com/quote.php</a><!-- m -->

and then stick on the end of that above.Ok then, thanks, scoutt, I'll try that right now.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.

<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?threadid=28446&perpage=15&pagenumber=1you">http://www.htmlforums.com/showthread.ph ... umber=1you</a><!-- m --> don't need the htaccess if done correctly.Isn't the .htaccess there to redirect the .jpg image to the .php page so when you do the thing, you can put the .jpg since the [img] doesn't allow .php?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.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
 
Back
Top