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
redirect Header function fails with query string
Moderator: General Moderators
Re: redirect Header function fails with query string
Have you tried with the variable in the "", because that seems to work for me
Like this:
Like this:
Code: Select all
header( "Location: addtemplatetask.php?func=Reset&ID=$InitialTemplateID");
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: redirect Header function fails with query string
It's not really redirecting: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
Code: Select all
error_reporting(E_ALL);
ini_set('display_errors', '1');mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.