-2

When trying to run my code, it returns me that:

Cannot modify headers already sent

<?php 

 if(!isset($_SERVER['HTTP_REFERER'])){ 
 header("Location: http://www.example.com/1.php");
 }

?>
user3304007
  • 446
  • 1
  • 7
  • 17

1 Answers1

0

if you want to set a header you must not send any character before the command

header("Location: http://www.example.com/1.php");

remove all text before <?php open tag, for example che for spaces or return

danilonet
  • 1,757
  • 16
  • 33