I have recently been looking for a PHP script that changes an image when you refresh the page
Its kind of like this one on thehabbos.org:
http://thehabbos.org/randomad.php
On refresh it changes, also each one links to a website.
Printable View
I have recently been looking for a PHP script that changes an image when you refresh the page
Its kind of like this one on thehabbos.org:
http://thehabbos.org/randomad.php
On refresh it changes, also each one links to a website.
PHP Code:<?php
$images[] = "image1.jpg";
$images[] = "image2.jpg";
//...
shuffle($images);
header('location: '.$images[0]);
?>
---------- Post added at 09:47 PM ---------- Previous post was at 09:45 PM ----------
OR as the example
PHP Code:<?php
$images[] = "<a href=\"http://localhost/\"><img src=\"http://localhost/images/image1.jpg\" border=\"0\"></a>";
$images[] = "<a href=\"http://localhost/\"><img src=\"http://localhost/images/image2.jpg\" border=\"0\"></a>";
//...
shuffle($images);
echo $images[0]
?>
Oh thanks. you can close the thread now (Y)