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

Simple Question
I know this is a simple question, that if I knew what it was technically called i could probably loo

Including calander to page - will not show other months than current??
im trying to add an existaing calander onto a profile page by using Code: <?php include "

help connecting a form to php and then emailing the form
Ok. So, I made a form, and I need help to where when submitted, I get an email with the submitted de

'grab_files', multiple extension?
hey guys,

can anyone suggest a way to make to following line of code look for files with more

Unique Visitor Tracking
Hello. Currently, I run a voting site where voters are tracked by their IP address and can only vote

PHP mail() rejected by SMTP
I'm currently working on a newsletter application which is installed on a windows 2003 server runnin

Best PHP Documentation generator
Hello guys!

I would like to hear from you what is the best PHP documentation generator. Perso

PHP mail() returns true but doesn't work
First off I apologize if this is a newbie question, and I generally don't like asking questions that

Secure pages Sessions vs. Cookies & session_destroy() help
Im new here and new to PHP, I hope you can help me with some questions.

Im writing my web ap

php file erros / need help please
Hello

Someone decoded a zend file for me.. after uploaded it on ftp i get some errors, i trye

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