Hi! Before, I had this problem with session_start() - Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Users\Administrador\Documents\xampp\htdocs\login.php:1) in C:\Users\Administrador\Documents\xampp\htdocs\login.php on line 3 I've been surfing a bunch of php forums and they all say that i can't have any blank spaces before <?php tag. I've corrected it and now... nothing happens! It doesn't send the error message, but nothing happens! The purpose is that, after a correct login, it opens a new window with the current user's name. but the new page doesn't open. If I create a regular html link (with <a>), i manage to open the new page, but the session user name is not sent. Can anyone help me, please??!
So it never gets to the header()? Try, if(!empty($_SESSION['nome'])) Are you sure, $user is being filled so that $_SESSION['nome'] is getting the value? Echo all of the values to make sure they are filled.
Just as a matter of preventing injections, you'll probably want to clean all data that you post from a user form, especially if it interacts with a mysql_query. This can be done via htmlspecialchars() http://php.net/manual/en/function.htmlspecialchars.php or mysql_real_escape_string() http://php.net/manual/en/function.mysql-real-escape-string.php (I realize this has nothing to do with your question though)
Hi, I'm not a php expert but im sure i experienced the exact same problem. Have you tried putting session_start(); first followed by ob_start(); i.e.: <?php session_start(); ob_start(); Code (markup):
Sometimes it happens when /tmp folder is full if you see this error on all of your php based sites. Thats what I have experienced
Ah my favourite error (partially) Well straight to the point! Just as chtdatweb said, <?php session_start(); ob_start(); Code (markup): should do the trick! (At least it works for me)
^^ it really doesn't solve it, how about all files having errors like that? you should check error like this: Uploaded with ImageShack.us
wow that looks like the old EDIT you used to get with DOS. Anyhow, what editor are you using to save your php file?