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
Form File Upload
I've read through tons of resources and tutorials and as far as I can tell, my code is accurate, but
Creating XML with php
I need to creat an XML with php and have successfully produced a valid output.
The problem I hav
phph within href not showing php if change ? to &
Code: [Select]<a href="<?php echo $puser; ?>?m=<?php=(($m-1)&l
The repetition structure: the while statement not working
New programming student, have assignment as follows:
A restaurant has 4 lunch combos for custom
whats wrong with my code please help!!!
this is the error
Warning: mysql_close(): supplied argument is not a valid MySQL-Link res
Accept only alpha characters
I've got this bit of code ready for accepting a phrase:
Code: if (!eregi ("", $_POS
Credit card verification
I have a client who wants to process credit card transactions from his web site rather than the goin
Using the $_GET variable to view certain records
Hello,
First let me explain my problem, I have 2 pages the first page pull a list of Guide ti
Access database inside of a validation class
Hello,
For quite some time, I have been using functions to validate form input and access the
Help =( !! Upload Pics [PHP script]
Hello
I need help with a php script [MULTIPLE UPLOAD IMAGES] , where I want to add a feature (wat