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

The type or namespace name 'ServiceModel' does not exist in the namespace 'System'
When I locally run the website, it works just fine, but when I uploaded it to the hosting environmen

a multi dimensional array with for each
hi, I have been asked to write an array, I have Zone 2,3,4,5,6,7,8 each zone has 3 sections of weigh

foreach loop, assistance request
I would like some guidance on the usage of foreach as I try to parse through a large database and wh

Am i doing this wrong?
Im pulling from an Oracle database some info... one of which is a field count_pnums which is a NUMBE

Question about the upload of large files
Hi there,

I have a question about the upload of large files, like videos (files generally abo

SQl num_rows problem
when i try to count rows from an SQL select i get an warning

Code: [Select]$countviews = mysq

column name cancatenation within PL/SQL
I have a PLSQL store procedure, and the following statement is part of a subquery
fname||lnam

Probably a simple error...
I'm getting the error -- Parse error: syntax error, unexpected '{' in /home/content/c/s/t/csteffen24

Take info from one coloum and move to another
Hi all,

I have this:
Code: [Select]$array = "SELECT stock_id FROM stocks WHERE stock_

Scene graph using Direct3D?
There are several C++ scene graph based packages available for OpenGl, like say OSG,

http://w

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