var sidebar_align = 'right';
var content_container_margin = parseInt('350px');
var sidebar_width = parseInt('330px');
PHP5+Cookie = Pulling My Hair Out
I'm going nuts over this, so I'm hoping you guys can help. I've got a login script (aptly named login.php) that takes two GET parameters ( a username and password hash ).
If everything pans out, the server sets two cookies on the client. I had this working when it was all one huge login script, but now I've broken things down into discrete objects and files, and now the cookies refuse to be sent.
For example, the following code:
The cookie titled "ISmellSmoke" will be sent to the client without a problem. The cookie titled "ISmellFire" is not sent. So it appears the problem is related to
$session = new TSession ();
setcookie ( "ISmellSmoke" , 1 , time ()+ 60 * 60 * 24 * 30 , "/" , ".mydomain.com" , 0 );
$login = new TLogin ();
setcookie ( "ISmellFire" , 1 , time ()+ 60 * 60 * 24 * 30 , "/" , ".mydomain.com" , 0 );
$login -> Login ();
$login = new TLogin();
But that line produces no ouput, and no errors (that I've seen). The class has no constructor, so no other code is run.
Any clue what the problem is?
I solved it!
...is your best friend.
error_reporting ( E_ALL );
Once I did that, I got a very nice warning telling me that the second cookie could not be sent because output had already been sent.
The TLogin class is stored in a file named TLogin, and is required through the PHP5 autoloader.
Each of the included files must start with <? and end with ?>
I had made the mistake of having a single extra linefeed after the ?> which was being sent to the browser as a blank line (or possibly a space).
Go figure. I spent nearly 2 days on this.