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!
I've only started to use php sessions but I keep getting an error. Can someone tell me why my code below doesn't work? Firefox says my problem is in line 21 (line 18 here) which is header ("Location: http://localhost/labs/php_sessions/page2.php"); but how can that be?
Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\labs\php_sessions\index.php:19) in D:\xampp\htdocs\labs\php_sessions\index.php on line 21
Thanks , JKM. I see where you're getting at. I studied it and now I know where I went wrong. You can't use header() when HTML has already been generated since the headers have already been sent. Stupid me.