0

Hello Dani Members I Have Question About My Code

<?php
$id = intval($_GET["id"]);
$result = mysql_query("SELECT * FROM peoples ORDER BY RAND() LIMIT 1");
while($row = mysql_fetch_array($result))
{
echo "$row[name]<br/>
<a href='members.php?id=$row[id]'><img class='img_shadow' src='$row[image]' width='198' height='250' alt='$row[name]' /></a>";
}
?>

This Code Get Me Image Of ONe Member And His Name Random

I need It To Show Another Member Every 5 Second Like Slide show

I tried Some jQuery Cycle Plugins But I Failed To get What I Need

Everytime I Click Refresh It Change The Query So I Need It To Show Automatically

I Hope I Explained My Question

3
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by -==Zero==-
1

I think what you need is automatic page refresh using javascript

Following javascript function will do the trick

<head>
    <script type="text/JavaScript">
        function refreshPage(timeoutPeriod) 
        {
            setTimeout("location.reload(true);",refreshPage);
        }
    </script>
</head>

Do the initial call in body onload

<body onload="JavaScript:refreshPage(5000);">
0

Thanks Sir Is This Refresh The Whole Page ?

I just Need The Image To Change

Just Like Slideshow

0

Yes it is for whole page refresh. You can use AJAX to refresh only the image or also you can keep an array of images like @pritaeas suggested

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.