a different sig each time
While we're at it here's something that should be fun to do, however I'm quite clueless on how to do it.
I figured out at some point that a certain user on a certain forum had turned its signature in a way such as when you hit the "reload" button on your browser, the image displayed in his signature at the bottom of each of his posts was changing each time. Do you know how he might have done it ? All I can say is that I believe there's some PHP involved. |
Re: a different sig each time
PHP Code:
|
Re: a different sig each time
the problem is that forum softwares don't allow PHP in the users' signatures :)
I believe the guy used something like this: <IMG src="http://hisdomain.com/image.jpg"> but the JPG image was in fact a PHP file, that would open a file at random in the directory and directly send its content over the network. I don't konw if this is feasible, though. |
Re: a different sig each time
php can generate random images so put the phpcode on YOUR php enabled server then put the image tags here pointing to a image.php file stead of image.jpg
Might be better to generate the image on the fly rather then the example above, see the php image() function. |
Re: a different sig each time
lets see if this works... Heres a graph bar I use on my site.
http://bs-linux.com/stats/loadgraph....th=25&avg=0.25 http://bs-linux.com/stats/loadgraph....th=58&avg=0.58 http://bs-linux.com/stats/loadgraph.php If this works note that both images are the same php file with different ?width settings... ok so a .php file is ok just can't have any ?blah=blah stuff at the end... If you click the links you will see that the image changes based on my width setting. You can use the image() function to make your sig random looks like. Just do a image from jpg in your php and then randomly use one of the 2 or more images you wish from your site. http://php.net/image for more info on this... |
Re: a different sig each time
btw the other suggestion prolly wont work. Reason is it outputs html whereas using the image function outputs actual image header info for png, jpg, gif or whatever type you tell the php code to dynamically generate.
take this sample code from the php.net link I gave before... Code:
<?php if($num == 1) {$im = imagecreatefrompng("pic1.png"); if)$num == 2) ($im = imagecreatefrompng("pic2.png"); etc... |
Re: a different sig each time
hey thanks a lot! how could I forget the trusty php.net resource center :)
that's exactly what I need :) |
Re: a different sig each time
Code:
<?php Like that perhaps. :) |
Re: a different sig each time
nice work.
|
Re: a different sig each time
I was to post about the same thing :D
PHP Code:
|
All times are GMT +2. The time now is 04:21. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.