Random image
Random image
I have put the random image script a few times on one webpage. Right now it shows the same image over and over on the same webpage. Is there a modification that I could do to the script that will ensure that a new random image is displayed every time?
Re: Random image
Why don't you post your website URL so we can check if the script is called correctly?
Also, if your server has any code caching enabled, try disabling it for the folder where random image script is located.
Also, if your server has any code caching enabled, try disabling it for the folder where random image script is located.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 1
- Joined: Wed Sep 27, 2017 3:43 pm
Re: Random image
I added the following to the beginning of the randim.php file to stop the generated images from being cached:
header("Content-type: image/png");
header("Cache-Control: no-cache");
header("Pragma: no-cache");
For other image types, just change the content-type accordingly, e.g. image/gif
header("Content-type: image/png");
header("Cache-Control: no-cache");
header("Pragma: no-cache");
For other image types, just change the content-type accordingly, e.g. image/gif