Jump to content

header("Location: page.php"); redirects to page but seems to load cached version


hollettster

Recommended Posts

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.

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:

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.