0

The following is my redirect function

function redirect_to($page = NULL) {
    if ($page != NULL) {
           header("page: {$page}");
           exit;
    }
 }

now the problem is when I call this function it does not work on some pages... Why ?

Thank you

bbonev
  • 1,406
  • 2
  • 16
  • 33
Nabstar
  • 43
  • 1
  • 12

1 Answers1

1

Using the following will make the redirect work:

header("Location: {$page}");

Because Page: is not a valid HTTP header and gets ignored by browsers.

bbonev
  • 1,406
  • 2
  • 16
  • 33