I write a simple script for test header statement.I expect my script show a warning message and dont transmit to another page but unfortunately, i am transmited to another page.
my question is this, is there any setting in php.ini that is related with blank space that is sent to the browser before header statement .
my experimental script is as follow as:
Expand|Select|Wrap|Line Numbers
- <?php
- ini_set("error_reporting", E_ALL);
- ini_set("display_errors", "on");
- ?>
- <?php
- $a = 'ali';
- if($a == 'ali') {
- header("Location: index2.php");
- }
- ?>
- <h1>you dont transmit to another page</h1>