PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Warning: Cannot modify header information - headers already sent by (output started at /var/www/2006.04.18/ligabd.php:12) in /var/www/2006.04.18/login.php on line 30
if there are any spaces before and after the php tags it will trigger an error like that and you cant have any output (echo/ print_r) before the header redirect line
rubberjohn wrote:if there are any spaces before and after the php tags it will trigger an error like that and you cant have any output (echo/ print_r) before the header redirect line
rj
damn... i didnt know PHP had this strict rules... well.. i gess it should be due to spaces somwhere.
BTW... sorry this being a stupid question... but... allways beter to ask..
does an echo inside an IF which condition is not satisfied generates one of those errors? or should i only be carefull about echos that are runned successfully?
// this will work
$x = 2;
if($x == 1){
echo 'that';
}
header("Location: xxx.php");
// this will not work
$x = 2;
if($x == 2){
echo 'that';
}
header("Location: xxx.php");
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.