PHP webpage & array print issue


Posted on 16th Feb 2014 07:03 pm by admin

I have this code running, and it works perfectly … however, see my bottom bit about what I see when I view source, versus what I want to see … I am having image re-sizing issues that started when I use this code. When I hard code img tags directly to the images, all works fine.

rotate.php
Code: <?php
Did you know?Explore Trending and Topic pages for more stories like this.
$images=array(
"darin_1.jpg", "darin_2.jpg", "jeffb_1.jpg", "jeffb_2.jpg", "jeffb_3.jpg", "glenda_1.jpg", "glenda_2.jpg", "glenda_3.jpg", "glenda_4.jpg", "kevin_1.jpg", "kevin_2.jpg", "kevin_3.jpg", "kevin_4.jpg",
"petrina_1.jpg", "petrina_2.jpg", "mia_1.jpg", "mia_2.jpg", "dale_1.jpg", "paul_1.jpg", "raino_1.jpg", "raino_2.jpg", "raino_3.jpg", "sherri_1.jpg", "sherri_2.jpg"
);
$total=count($images);
$secondsFixed=5; // seconds to keep list the same
$seedValue=(int)(time()/$secondsFixed);
srand($seedValue);
for ($i=0;$i<$total;++$i) // shuffle list 'randomly'
{
$r=rand(0,$total-1);
$temp =$images[$i];
$images[$i]=$images[$r];
$images[$r]=$temp;
}
$index=(int)($_GET['i']); // image index passed in
$i=$index%$total; // make sure index always in bounds
$file=$images[$i];
header("Location: $file"); // and pass file reference back
?>
No comments posted yet

Your Answer:

Login to answer
97 Like 23 Dislike
Previous forums Next forums
Other forums

read integers that returns a negative or prints the average
Im trying to finish this homework assignment by tommarow afternoon and I keep getting stuck.
Wr

Material Issuing for receiving batch
Dear All experts in MM/ PP,

Material issuing from main stores to factory is currently usi

how to read and write into a word document using php...?
hi,
I need,reading and writting into a word document using php.




Thank u inadva

php include email form with attachment
I have had no luck with finding a email form all over the Internet for various reasons. Some insecur

Data Function is Its Not working IN IE8
This is my first time to use formums. I hope i can get solution for this problem. view plaincopy to

The page should be expire when cilck back button
hi,
i'm new to php world.
i create user registration page.
when i submit it,data goes to my

Executing an exe
Hi. I have some bizarre problem with exec (other any other method) to launch exe's. I am making a ga

Custom CMS
This is a big custom CMS script I'd like to develop and would like some help atleast figuring out wh

php and downloading
I want to use a php script to create two files. Then I want it to redirect (or whatever) to have tho

how to put the 0-100 numbers into 1.txt and 100-200 into 2.txt ?
how to put the 0-100 numbers into 1.txt and 100-200 into 2.txt and so on 200-300 into file 3.txt ?

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash