nadeemshafi9 Posted December 30, 2007 Share Posted December 30, 2007 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.. Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted December 30, 2007 Author Share Posted December 30, 2007 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"); Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 30, 2007 Share Posted December 30, 2007 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 Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 30, 2007 Share Posted December 30, 2007 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. Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted January 7, 2008 Author Share Posted January 7, 2008 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.