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
23
Other forums
in php, link returns to the line
When I add a link in a php page, the link word returns to the line (as a
would do)
Examp
Page doesn't expand for content
Hi. I've been testing a query I made. It's here http://lapr1.6te.net/inquerito.php
The page doesn
PEAR Email Attachment w/ $gpg
I have no issues with this code if I take out the attachement section and include the info in the em
Help with form post data and arrays
Hi all,
I am new to this forum... It has been awhile since i have worked with arrays, and i a
How to limit the calls to an API
Hello, in my simple script I call an api which effectively involves me getting an xml file.
H
Unique Visitor Tracking
Hello. Currently, I run a voting site where voters are tracked by their IP address and can only vote
Polymorphism
Was wondering if someone could explain this a little better to me. I had always assumed that it had
Batch Related Pricing
Hi, I need some clarity on the batch related pricing
For example the following are the b
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 problems
I am having a small problem with my sql statement. it is inserting into 4 of the fields.
fie