NYCPHP Meetup

NYPHP.org

[nycphp-talk] redirect problem

John Nunez john at cyber-ny.com
Wed Dec 15 15:06:03 EST 2004


I think the problem is with the browser specs.  Using header( 'location: 
http://...com' ); cause the browser to receive a Error Code #302(?) and 
it will redirect to the new url that has been supplied but it's a 
temporary redirect. On refresh the browser will attempt the original 
url.  The method I use to fix this is:
echo '<script language="Javascript">location.href="http://...com"</script>';

There might be a better/proper way of re-directing the browser.

Rahmin Pavlovic wrote:
> Hello all,
> 
> I'm feeling especially out of it today - maybe someone here can help -
> 
> I have a page here that checks the db for a certain condition, which if met,
> redirects the user to another page.
> 
> That condition can be set by an external process, so it's entirely possible for
> the condition to be met while the user is on the page.  If that's the case, and
> the user hits reload, redirect.
> 
> So far so good.
> 
> The problem here is that, after being redirected, if the user hits reload on the
> new page, the previous page comes up.  Actually, the real problem is:  I don't
> know why it's doing that.
> 
> Has anyone experienced this before?  My header hurts..
> 
> 
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.newyorkphp.org
> 



More information about the talk mailing list