I have this code :
<?php
session_start();
echo "".$_SESSION['eventnum']."";
$urlRefresh = "testremot.php";
header("Refresh: 5; URL=\"" . $urlRefresh . "\"");
?>
but the header doesn’t work and this warning appear when I try to run this code:
Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\remot\testremot.php:3) in C:\xampp\htdocs\remot\testremot.php on line 5**
Can you please help me?
Ok, lets see what you have in
line 3:Obviously you are generating output (
echo) in this line and this line comes before you callheader.Move it below
header:But note (from Wikipedia):