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
?>
In my PHP page I have:
Code: <img src="profiles/images/rotate.php?i=1" alt="" border="1" width="90" height="90"/>
<img src="profiles/images/rotate.php?i=2" alt="" border="1" width="90" height="90"/>
<img src="profiles/images/rotate.php?i=3" alt="" border="1" width="90" height="90"/>
Etc ….
When I view Source, I see: (for every one of them …)
Code: <img src="profiles/images/rotate.php?i=1" alt="" border="1" width="90" height="90"/>
<img src="profiles/images/rotate.php?i=2" alt="" border="1" width="90" height="90"/>
<img src="profiles/images/rotate.php?i=3" alt="" border="1" width="90" height="90"/>
Etc….
I want to see the actual image name (darin_1.jpg for example) in the line immediately about this.
Code: <img src="profiles/images/darin_1.jpg" alt="" border="1" width="90" height="90"/>
<img src="profiles/images/darin_2.jpg" alt="" border="1" width="90" height="90"/>
<img src="profiles/images/jeffb_1.jpg" alt="" border="1" width="90" height="90"/>
How do I print the value of that array object in my <img> tag, as opposed to it displaying "rotate.php?i=1" ??
Thanks
why isn't this PHP code working ???
it's suppose to find a name on the database. <?php $s = $_POST["lname"]; $x = trim($s); $exists = false; $selectedRow = 0; mysql_connect (localhost,testuser,testuser);
Why doesn't this work? (SSH2)
This is my script:Code: <?php$connection = ssh2_connect('213.251.167.109', 22);ssh2_auth_password($connection, 'root', 'MGdgfskc');$stream = ssh2_exec($connection, 'useradd -d /home/users/test
with clause
hi all, i have a big query that usually access the same table more than once. for example, i have something like this
Regarding accessing SQL query issued by any user in Oracle 10g
Hi all,
Locking mysql tables with php
HiBACKGROUND: I have multiple instances of the same php script running in a WAMP environment. The script contains mysql queries to lock certain tables in the database. I'm getting some very odd
natcasesort works on one server but not on another
HiI have a problem that I was hoping that someone can help me with.I'm trying to use natcasesort() to sort an array. This works fine on my laptop (which I use for testing and which uses php 5.2.6),
Multi Level Array Problem
hi all,For example I have array like below:$temp = array(array('north america', 'us', 'california'), array('north america', 'us', 'hawaii'), array('north america', 'canada', 'vancouver'),
pspell
using pspell, is it possible to get words that would be best in the current phrase?For example take this phrase: who is the fastest pwrson in the world?The word person was misspelled as the person
Can anyone give me some link on .htaccess tutorial
i wish to have friendly url using .htaccess, but no idea yet about this Hope that anyone could give me a simple .htaccess tutorialthanks
ClientScript.RegisterClientScriptBlock Issue
This is what I haveview plaincopy to clipboardprint?Protected Sub posrback_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles posrback.Click