Im a PHP noob, trying to make a random picture generator with a random image button. When I click the button I want a new image to come up. How ever this only works once. What should I change to make it work several times?
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
function changeImage()
{
var img = document.getElementById("image");
img.src="/cats/<?php echo rand (1,92);?>.jpg";
return false;
}
</script>
</head>
<body>
<img id="image" src="/cats/<?php echo rand (1,92);?>.jpg" width="500" height="500" />
<br><br><br>
<button id="clickme" onclick="changeImage();">Click to change image!</button>
</body>
Thanks in advance!