Page 1 of 1

redirect Header function fails with query string

Posted: Thu Feb 04, 2010 9:55 am
by tcl4p
I'm trying to use the php header function to redirect the current page back to itself and use a query string to pass parameters back to the page. While the redirect works, what happens is the URL that appears is the original URL, with the original query string. Here is the code I'm using for the redirect.

header( "Location: addtemplatetask.php?func=Reset&ID=".$InitialTemplateID);

Any help would be appreciated.

Tom

Re: redirect Header function fails with query string

Posted: Thu Feb 04, 2010 10:00 am
by lshaw
Have you tried with the variable in the "", because that seems to work for me

Like this:

Code: Select all

 
header( "Location: addtemplatetask.php?func=Reset&ID=$InitialTemplateID");
 

Re: redirect Header function fails with query string

Posted: Thu Feb 04, 2010 10:57 am
by AbraCadaver
tcl4p wrote:I'm trying to use the php header function to redirect the current page back to itself and use a query string to pass parameters back to the page. While the redirect works, what happens is the URL that appears is the original URL, with the original query string. Here is the code I'm using for the redirect.

header( "Location: addtemplatetask.php?func=Reset&ID=".$InitialTemplateID);

Any help would be appreciated.

Tom
It's not really redirecting:

Code: Select all

error_reporting(E_ALL);
ini_set('display_errors', '1');