pugboy Posted July 9, 2008 Share Posted July 9, 2008 Yes, I DID read the sticky, and CAN NOT figure out this header problem... <?php $user = $_POST["user"]; $pass = md5(md5(md5($_POST["pass"]))); mysql_connect("localhost", "****", "****") or die(mysql_error()); mysql_select_db("ffforum_shop") or die(mysql_error()); $q = "SELECT pass FROM user WHERE user = '" . $user . "'"; $result = mysql_query($q); list($passv) = mysql_fetch_array($result); if(!$pass==$passv){ die("Wrong password. Press your back button to try again."); } $q = "SELECT id FROM user WHERE user = '" . $user . "'"; $result = mysql_query($q); list($store) = mysql_fetch_array($result); setcookie('user', $user, $time); setcookie('sid', $store, $time); ?> Logged in correctly. Head over to the <a href='panel/index.php'>Control panel</a>. Does ANYONE see ANYTHING wrong with this? I see no whitespace in the WHOLE entire code!!! Am I being really stupid? Link to comment https://forums.phpfreaks.com/topic/113991-solved-ugh-headers-already-sent/ Share on other sites More sharing options...
discomatt Posted July 9, 2008 Share Posted July 9, 2008 UTF-8 encoding? Could be the BOM Link to comment https://forums.phpfreaks.com/topic/113991-solved-ugh-headers-already-sent/#findComment-585848 Share on other sites More sharing options...
DarkWater Posted July 9, 2008 Share Posted July 9, 2008 Yeah, is it encoded in UTF-8? Are you including any files that potentially have whitespace after the last PHP tag? Link to comment https://forums.phpfreaks.com/topic/113991-solved-ugh-headers-already-sent/#findComment-585850 Share on other sites More sharing options...
pugboy Posted July 9, 2008 Author Share Posted July 9, 2008 Not including anything (that was the whole code)... I think it is UTF-8 though... Sharepoint is being annoying XD Ok, it works Thanks Link to comment https://forums.phpfreaks.com/topic/113991-solved-ugh-headers-already-sent/#findComment-585851 Share on other sites More sharing options...
discomatt Posted July 9, 2008 Share Posted July 9, 2008 UTF-8 by default will have a Byte Order Marker that is outputted to the browser. Find an editor that allows you to disable to UTF BOM Link to comment https://forums.phpfreaks.com/topic/113991-solved-ugh-headers-already-sent/#findComment-585853 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.