Rantext

In case you have problems with some other PHPJunkyard script (not that there are THAT many).
Post Reply
lesm
Posts: 2
Joined: Fri May 29, 2020 6:38 pm

Rantext

Post by lesm »

HI,
I like the script for its simplicity but unfortunately it doesn't work as expected in my CMS TYPO3 site.
It only displays a text the first time I access the site. Then at each new page rendered the script doesn't displays a new text line. In short the text line displayed never changes unless you manually reload the page.
I call the script from the page template:
<script src="/berandom/rantex.php?type=1"></script>

Any idea?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Rantext

Post by Klemen »

The result is probably cached in the browser.

Try this:

1. open rantex.php in a plain text editor such as Notepad++
2. find

Code: Select all

header("Content-type: text/javascript");
3. below #2 add

Code: Select all

    // Tell browsers not to cache the pages
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
4. save, upload and test (you will need to refresh the page the first time)
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image 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
lesm
Posts: 2
Joined: Fri May 29, 2020 6:38 pm

Re: Rantext

Post by lesm »

Hi Klemen,
Please apologize for being so late. I couldn't modify the script until today cause I was very busy working from home.
You're right the result was cached in the browser. Your suggestion fixed it and now it seems to be working okay, at least in my testing server. Tomorrow I will modify the production server and will let you know if anything goes wrong.
Thank you for your help and best regards.
Post Reply