php Sig Rotate Help

Soldato
Joined
9 Nov 2004
Posts
13,984
Location
Pembrokeshire
hey all,

can't get a sig rotation working for some reason.

i've made a www.projectTTA.com/sigs directory on my server where i've got a rotate.php script, then i've got www.projectTTA.com/sigs/sigs where i've got all the actual images kept.

but when i put [*img]www.projectTTA.com/rotate.php[/*img] (minus the asterix) it doesn't work.

two scripts i've tried for the php file are as follows

Code:
<?php


$files = glob('{*.PNG,*.png,*.JPG,*.jpg,*.GIF,*.gif}', GLOB_BRACE);
readfile($files[array_rand($files)]);


?>
thats from http://robm.me.uk/articles/image-rotation-in-php/

and i've tried the code from the sticky in General Discusion

Code:
<? 

$array[200]; 
$elem = 0; 
$dirname = "sigs"; 
$dh = opendir($dirname); 
while ($file = readdir($dh)) { 
if (!is_dir("$dirname/$file")) 
$array[$elem] = $file; 
$elem = $elem + 1; 
} 

srand((double)microtime() * 10000000); 
$rand_keys = array_rand($array); 
$temp = $array[$rand_keys]; 

header("Location: $dirname/$temp"); 

?>

anyone got any clues as to whats i'm doing wrong?


edit:

the two sigs i'm trying to rotate are at:
http://www.projecttta.com/sigs/sigs/1.jpg
http://www.projecttta.com/sigs/sigs/2.jpg

and both are actually there

1.jpg


2.jpg
 
strange, i've popped the three images into the directory with the php script in it and now it just generates random text.

http://www.projecttta.com/sigs/rotate.php

:confused:

it's definately php enabled, we've had forums on the website before we stopped working on the site, so no problems with php...

hmm... just checked the forums and get this

phpBB : Critical Error

Could not connect to the database
 
LOL well its working a treat now, cheers for the help guys :)

no idea what was wrong with it, as to be honest apart from making the mistake of putting it into dreamweaver rather than notepad i haven't done anything else to change it :confused:

TY again :)
 
Back
Top Bottom