Creating a dynamic signature

Anything technology related that does not fit in other categories
tw2
Posts: 99
Joined: Wed Sep 24, 2003 9:11 pm

Creating a dynamic signature

Post by tw2 »

funny stuff :P

Archived topic from Iceteks, old topic ID:1293, old post ID:11946
Chris Vogel
Posts: 5140
Joined: Fri Jan 10, 2003 1:14 am

Creating a dynamic signature

Post by Chris Vogel »

http://www.google.com/search?q=sig_randomi...=utf-8&oe=utf-8

Perhaps? :grade11math:

EDIT: Click on the only link there. For some reason, I can't post the URL! I paste it into here, but it changes to what Wldkos has when I post! :grade11math: :blink:

Archived topic from Iceteks, old topic ID:1293, old post ID:12015
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

let me try

http://www.puttrich.net/rtsupport/sig_randomizer/

Archived topic from Iceteks, old topic ID:1293, old post ID:12019
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

Hey red, how about some help with this one? I see your sig change all the time using opera...

I have my .htaccess file in my /sig directory with about 15 banners...

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");

?>
Then I have a "number.txt file with just a "0" in it, that's all. What's going on here?

Archived topic from Iceteks, old topic ID:1293, old post ID:12020
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

for some reason, the script is using the images with linnks and putting a "/sunkos_i.png%22);" after it.... so it can't find the image since there is no image with a %22 after it (%22 I assume is ";")

Archived topic from Iceteks, old topic ID:1293, old post ID:12021
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

Hmm should work, but did you download the number.txt to see if it changed? I know it took my a while on mozilla to see if it worked since it kept caching it even though I told it not to. Opera does not work very well with these sig changers either, especially different sizes.

But that code should work, I think it's just a cache problem.

But check the article again since this part does not work half like I figured it would so I changed it:

$number = $number+3; //adding 5 makes it a bit more random

if($number>9)$number=$number-9;

It just adds the number instead.

Archived topic from Iceteks, old topic ID:1293, old post ID:12022
Honk if you love Jesus, text if you want to meet Him!
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

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.

Archived topic from Iceteks, old topic ID:1293, old post ID:12034
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

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.
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.



Archived topic from Iceteks, old topic ID:1293, old post ID:12039
Honk if you love Jesus, text if you want to meet Him!
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

So are you going to give us the updated script and directions then?

Archived topic from Iceteks, old topic ID:1293, old post ID:12046
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

wldkos wrote: So are you going to give us the updated script and directions then?
It's already there. :)

http://www.iceteks.com/articles.php?act=vi...icle=dynsig&p=1

Archived topic from Iceteks, old topic ID:1293, old post ID:12047
Honk if you love Jesus, text if you want to meet Him!
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

blah, thanks for telling me now! :P

Archived topic from Iceteks, old topic ID:1293, old post ID:12054
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

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?

Archived topic from Iceteks, old topic ID:1293, old post ID:12055
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

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?
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.

Archived topic from Iceteks, old topic ID:1293, old post ID:12056
Honk if you love Jesus, text if you want to meet Him!
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

Red Squirrel wrote:
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?
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.
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?

Archived topic from Iceteks, old topic ID:1293, old post ID:12057
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

wldkos wrote:
Red Squirrel wrote:
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?
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.
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?
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. :)

Archived topic from Iceteks, old topic ID:1293, old post ID:12060
Honk if you love Jesus, text if you want to meet Him!
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

can't have them all in the same folder? Cuz I am not putting the full url, just relative since the script is with the images.

Archived topic from Iceteks, old topic ID:1293, old post ID:12062
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

changed that.. Put in the full url and as youc an tell by my sig, nothing is working


Archived topic from Iceteks, old topic ID:1293, old post ID:12063
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

ok layout:
public_html/sig/ < this is where the files are...
my images (real ones) are in the /sig directory.
I have an .htaccess file in the /sig directory that says this and only this:
ForceType application/x-httpd-php
then I have "number.txt" with only a single "0" (zero) in it.

then I have "sig.jpg" which is the php code renamed to jpg

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]
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

You are still doing it wrong. The /sig directory with the images should NOT have the .htaccess file. Do a /sig/random/ directory and put the .htaccess in there along with the fake jpg and the number.txt and it should work. :)

Archived topic from Iceteks, old topic ID:1293, old post ID:12065
Honk if you love Jesus, text if you want to meet Him!
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

Ok I now have /sig with the banners in it and then /sig/random with .htaccess, number.txt and sig.jpp (php code)...

not working.

Archived topic from Iceteks, old topic ID:1293, old post ID:12074
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

quite wierd, but almost there... if you go here http://worldchaos.no-ip.com:12123/wldkos/sig/random/sig.jpg you can see that it's trying to dislpay an image, well atleast in opera, I see the text "image". The complete url is correct to the banners... what if i just put ../../banner.jpg? since it's /sig/random/sig.jpg

Archived topic from Iceteks, old topic ID:1293, old post ID:12075
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

I get

http://worldchaos.no-ip.com:12123/wldkos/sig/random/sig.jpg

The script probably has a parse error or something, look for a missing semi colon and what not.

Archived topic from Iceteks, old topic ID:1293, old post ID:12076
Honk if you love Jesus, text if you want to meet Him!
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

I really do not know what's up with this. If someone else got this to work with red's script. I'd like to know how.

Archived topic from Iceteks, old topic ID:1293, old post ID:12083
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Creating a dynamic signature

Post by Red Squirrel »

Can't see why it's not working though. I think it's some kind of miss configuration, like did you chmod to 777? (the folder) it has to be able to read the file and write to it.

Archived topic from Iceteks, old topic ID:1293, old post ID:12085
Honk if you love Jesus, text if you want to meet Him!
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Creating a dynamic signature

Post by wldkos »

all the folders necessary are 777 as of now, and it's still not working. when I use the image though I do this right? <img>http://worldchaos.no-ip.com:12123/wldko ... g.jpg</img>


substitute [] for <>

Archived topic from Iceteks, old topic ID:1293, old post ID:12091
Locked