echo is not printing before header Location in php 5.6 -


this question has answer here:

in php page if use echo print it's not showing printed output. happens in case use header location. if header location not there it's printing.

see code

echo "to print here";  header("location: package.php"); 

after executing not able see output. if remove header("location: package.php"); output printing.

please me.

i using wamp server 3 php 5.6

what need not possible php headers must sent out before content, correct order is:

header("location: package.php"); echo "to print here"; 

but redirect instantly , not see content. should redirection js:

echo "to print here"; echo '<script>settimeout("document.location.href = 'http://www.thepageuouwant.com/package.php';",500);</script>'; 

this way show message after half second (500ms) user redirected new page.


Comments