Creating a dynamic signature
Posted: Fri Sep 26, 2003 4:08 pm
funny stuff
Archived topic from Iceteks, old topic ID:1293, old post ID:11946
Archived topic from Iceteks, old topic ID:1293, old post ID:11946
Formally anythingforums.com, iceteks.com, uovalor.com and uogateway.com Forums.
https://www.anyf.ca/
http://www.google.com/search?q=sig_randomi...=utf-8&oe=utf-8
Then I have a "number.txt file with just a "0" in it, that's all. What's going on here?
ForceType application/x-httpd-php
<?php
//decide what image number we will display
$numberfile = fopen("number.txt","r");
$number=fgets($numberfile,10);
fclose($numberfile);
$number = $number+3; //adding 5 makes it a bit more random
if($number>9)$number=$number-9;
$numberfile = fopen("number.txt","w");
fputs($numberfile,$number."
"); //rewrite the new number to file
fclose($numberfile);
//display the right image depending on what the number is:
if($number==1)header("Location: http://worldchaos.no-ip.com:12123/wldkos/s...2_a.jpg");
if($number==2)header("Location: http://worldchaos.no-ip.com:12123/wldkos/s...s_b.jpg");
if($number==3)header("Location: http://worldchaos.no-ip.com:12123/wldkos/s...k_c.png");
if($number==4)header("Location: http://worldchaos.no-ip.com:12123/wldkos/s...m_d.jpg");
if($number==5)header("Location: http://worldchaos.no-ip.com:12123/wldkos/s...s_e.jpg");
if($number==6)header("Location: http://worldchaos.no-ip.com:12123/wldkos/s...r_f.jpg");
if($number==7)header("Location: http://worldchaos.no-ip.com:12123/wldkos/s...s_g.jpg");
if($number==8)header("Location: http://worldchaos.no-ip.com:12123/wldkos/s...r_h.gif");
if($number==9)header("Location: http://worldchaos.no-ip.com:12123/wldkos/s...s_i.png");
?>
That's just the forum doing that, it's because it just takes everything after http:// so if there's no space it still takes it, it would have tocheck if the url goes somewhere or not and doing that char by char would be very taxing, and most of the time we put at least one space after typing a url anyway.wldkos wrote: I honestly think it's the syntax in the linking since when you click on the image links in my htaccess it gives you and error cuz it's including "');" in the url. I do not know enough php to fix that though.
It's already there.wldkos wrote: So are you going to give us the updated script and directions then?
Yes, the folder has to be dedicated for the "Fake" image. Don't put real images in there as they will try to run as php.wldkos wrote: wait... so now I am supposed to make a php file with the code in there but rename it to jpg? What if I have gifs and png's in there as well?
so right now... I have an .htaccess file with the code linking to the images in there. Then in the same directory I have all the images and the number.txt file with "0" in it. Where do I fix this?Red Squirrel wrote:Yes, the folder has to be dedicated for the "Fake" image. Don't put real images in there as they will try to run as php.wldkos wrote: wait... so now I am supposed to make a php file with the code in there but rename it to jpg? What if I have gifs and png's in there as well?
You should have a seperate "normal" folder with real images, then somewhere else a folder that has a .htaccess to turn jpg into php, and then you put the fake jpg file and number.txt, and the jpg file should link to the images in the "normal" folder with the real images.wldkos wrote:so right now... I have an .htaccess file with the code linking to the images in there. Then in the same directory I have all the images and the number.txt file with "0" in it. Where do I fix this?Red Squirrel wrote:Yes, the folder has to be dedicated for the "Fake" image. Don't put real images in there as they will try to run as php.wldkos wrote: wait... so now I am supposed to make a php file with the code in there but rename it to jpg? What if I have gifs and png's in there as well?
then I have "number.txt" with only a single "0" (zero) in it.ForceType application/x-httpd-php
Code: Select all
<?php
$images = 9; //number of images
//---- file management stuff ----
$numberfile = fopen("number.txt","r");
$number=fgets($numberfile,10);
fclose($numberfile);
$number=$number+1;
if($number>$images)$number=0;
$numberfile = fopen("number.txt","w");
fputs($numberfile,$number."n");
fclose($numberfile);
header("Cache-Control: no-cache, must-revalidate, no-store"); //force browsers to not cache it //display the right image depending on what the number is:
if($number==1)header("Location: http://worldchaos.no-ip.com:12123/wldkos/sig/bg52_a.jpg");
if($number==2)header("Location: http://worldchaos.no-ip.com:12123/wldkos/sig/chekaos_b.jpg");
if($number==3)header("Location: http://worldchaos.no-ip.com:12123/wldkos/sig/evilwk_c.png");
if($number==4)header("Location: http://worldchaos.no-ip.com:12123/wldkos/sig/freedom_d.jpg");
if($number==5)header("Location: http://worldchaos.no-ip.com:12123/wldkos/sig/fries_e.jpg");
if($number==6)header("Location: http://worldchaos.no-ip.com:12123/wldkos/sig/glassbanner_f.jpg");
if($number==7)header("Location: http://worldchaos.no-ip.com:12123/wldkos/sig/spiralchaos_g.jpg");
if($number==8)header("Location: http://worldchaos.no-ip.com:12123/wldkos/sig/star_h.gif.");
if($number==9)header("Location: http://worldchaos.no-ip.com:12123/wldkos/sig/sunkos_i.png.");
?>
[code] :pissed off:
[color=#888888][size=85]Archived topic from Iceteks, old topic ID:1293, old post ID:12064[/size][/color]