0810
09-08-2002, 11:05 PM
Problem with ramdom pictures
hi how are you doing? I am trying to put my pictures randamly. Whenever a user comes to my website, he can see different pictures. But my script didn't work at all. Just come out only same pictures whenever I test it.
my php is 4.2 Could you help my script.
Here is code
<?php
$pictures=array("Hideo.jpg","ito1.jpg","ito2.jpg","ito3.jpg",
"ito4.jpg","ito5.jpg","ito6.jpg","ito7.jpg","ito8.jpg");
shuffle($pictures);
?>
<html>
<head>
<title>Japanese Picture</title>
</head>
<body>
<center>
<h1>Japan</h1>
<table width=100%>
<tr>
<?
for ($i = 0; $i < 3; $i++)
{
echo "<td align= center><img src=\"";
echo $pictures[$i];
echo "\" width=100 height=100></td>";
}
?>
</tr>
</table>
</center>
</body>
</html>
Thank you very much
hi how are you doing? I am trying to put my pictures randamly. Whenever a user comes to my website, he can see different pictures. But my script didn't work at all. Just come out only same pictures whenever I test it.
my php is 4.2 Could you help my script.
Here is code
<?php
$pictures=array("Hideo.jpg","ito1.jpg","ito2.jpg","ito3.jpg",
"ito4.jpg","ito5.jpg","ito6.jpg","ito7.jpg","ito8.jpg");
shuffle($pictures);
?>
<html>
<head>
<title>Japanese Picture</title>
</head>
<body>
<center>
<h1>Japan</h1>
<table width=100%>
<tr>
<?
for ($i = 0; $i < 3; $i++)
{
echo "<td align= center><img src=\"";
echo $pictures[$i];
echo "\" width=100 height=100></td>";
}
?>
</tr>
</table>
</center>
</body>
</html>
Thank you very much