-5

I'm not sure what is wrong with this? (I know the URL is currently in this example), but why would this not work? It works fine on localhost, so why not on my http server?

<?php
header('Refresh:10; url=https://finesseshop.ca/**secret page**');
?>
Braiam
  • 1
  • 11
  • 47
  • 78
brandon
  • 1
  • 3

1 Answers1

1

Your syntax is invalid - HTTP headers cannot be used to cause a delayed redirect, and there's no Refresh header at all.

A Location header will redirect immediately. If you need the delay, you can use a meta refresh or a JavaScript setTimeout.

it says header already sent

That's a separate issue, but the code you show - by itself - cannot cause that error. Consult this question for information on what causes that error.

Community
  • 1
  • 1
ceejayoz
  • 176,543
  • 40
  • 303
  • 368