Jump to content

Recommended Posts

in php 5 on my windows machine local my javascript uses ajax to call a php script which gens a rand and then teh javascript inserts it into the page

......

http.open('get', 'test.php');

.....

 

it works fine on my lcal machine

 

1 ...... 3443 ..... 4353 ..... 5654 .... 35656

 

 

on my live server php4 apache its like the scrippt output is generated once then the output is cached maybe because it keeps giving me he same number

 

3 .... 3.... 3.... 3.... 3..

Link to comment
https://forums.phpfreaks.com/topic/83667-solved-ajax-prob-on-other-server/
Share on other sites

in php 5 on my windows machine local my javascript uses ajax to call a php script which gens a rand and then teh javascript inserts it into the page

......

http.open('get', 'test.php');

.....

 

it works fine on my lcal machine

 

1 ...... 3443 ..... 4353 ..... 5654 .... 35656

 

 

on my live server php4 apache its like the scrippt output is generated once then the output is cached maybe because it keeps giving me he same number

 

3 .... 3.... 3.... 3.... 3..

 

SOLVED

 

header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT");

header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . " GMT" );

header( "Cache-Control: no-cache, must-revalidate" );

header( "Pragma: no-cache");

 

note: in the future; refer to this forum for your ajax questions. ;)

 

http://www.phpfreaks.com/forums/index.php/board,51.0.html

  • 2 weeks later...

Note: It is also possible to add an (unused by your code) random GET parameter on the end of the URL being requested so that each request appears to be different from the last.

 

ur a smart man i wish i had thoght of that seems like a solution to many problems lol

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.