php: how do I redirect to another page?

dpopiz

Diamond Member
Jan 28, 2001
4,454
0
0
I just want to have the script do some stuff and then send the client to another page. BUT here's the kicker: the page that it goes to has to be loaded from the server, not from the client's cache.

I tried
header ("Location: $URL");
but that just loads it from the cache.
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
try this (taken from from PHP manual):

// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);

// HTTP/1.0
header("Pragma: no-cache");

header ("Locatin: $url");
exit(0);
 

Zugzwang152

Lifer
Oct 30, 2001
12,134
1
0
Originally posted by: dpopiz
I just want to have the script do some stuff and then send the client to another page. BUT here's the kicker: the page that it goes to has to be loaded from the server, not from the client's cache.

I tried
header ("Location: $URL");
but that just loads it from the cache.

You will have to make the page refresh itself in that case. this can't be done with PHP because it is server-side. You can do this with a client-side script like Javascript. Google pulled up this quick thread for you.