hollettster Posted October 8, 2014 Share Posted October 8, 2014 I have a page with results from a query that displays that has a link (works fine - passes variables etc) that deletes that line item from a database. It goes to the delete.php and actually executes and removes the item from the database and then has the line header("Location: page.php"); which returns BACK to the page displaying the results. However, it shows the old results until I hit Refresh in the browser. Its like the header is redirecting to a cached version of the page. NOTE: This script used to work fine untouched when we where on a shared hosting account. We JUST updates to VPS hosting by the same host. Now this problem has risen and I can't figure out what is wrong. From what I can guess is there is something in php.ini that is either not set, set or set wrong. Any help would be greatly appreciated. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/291515-headerlocation-pagephp-redirects-to-page-but-seems-to-load-cached-version/ Share on other sites More sharing options...
hollettster Posted October 8, 2014 Author Share Posted October 8, 2014 UPDATE: Figured it out. You have to edit php.ini and set session.cache_limiter = nocache instead of public Quote Link to comment https://forums.phpfreaks.com/topic/291515-headerlocation-pagephp-redirects-to-page-but-seems-to-load-cached-version/#findComment-1493072 Share on other sites More sharing options...
jcbones Posted October 8, 2014 Share Posted October 8, 2014 Note* you should also be using a fully qualified URI in the header function. From the manual Note: HTTP/1.1 requires an absolute URI as argument to » Location: including the scheme, hostname and absolute path, but some clients accept relative URIs. You can usually use $_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF'] and dirname() to make an absolute URI from a relative one yourself: Quote Link to comment https://forums.phpfreaks.com/topic/291515-headerlocation-pagephp-redirects-to-page-but-seems-to-load-cached-version/#findComment-1493086 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.