rjcfan4ever Posted July 5, 2011 Share Posted July 5, 2011 So I have 3 errors in my login script... If I wanna login in my login system (on my localhost) he gives this error: http://imageshack.us/photo/my-images/200/erroris.jpg This is the code on line 116: http://imageshack.us/photo/my-images/17/line116.jpg/ This is the code on line 118: http://imageshack.us/photo/my-images/3/line118.jpg/ This is the code on line 124: http://imageshack.us/photo/my-images/39/line124.jpg/ (Sorry but I can't place the image directly on the forum) Already thank you for helping me Quote Link to comment Share on other sites More sharing options...
TeNDoLLA Posted July 5, 2011 Share Posted July 5, 2011 You have outputted something before sending headers. You cant have any kind of output before headers. ACtually you have invalid PHP syntax also. You need to put that Key my site thing into "Key my site" or 'Key my site'. Same goes for the other line. Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted July 5, 2011 Share Posted July 5, 2011 you have posted broken image links and no code/errors... Quote Link to comment Share on other sites More sharing options...
rjcfan4ever Posted July 5, 2011 Author Share Posted July 5, 2011 Sorry for that, I eddit it Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted July 5, 2011 Share Posted July 5, 2011 most likely you are outputting code before either setting your cookies or using the header() function..which you cannot do, can you post your code so we can help Quote Link to comment Share on other sites More sharing options...
TeNDoLLA Posted July 5, 2011 Share Posted July 5, 2011 most likely you are outputting code before either setting your cookies or using the header() function..which you cannot do, can you post your code so we can help Well he will get errors atleast outputted before that header() call since he has invalid php syntax on the two first lines. Quote Link to comment Share on other sites More sharing options...
rjcfan4ever Posted July 5, 2011 Author Share Posted July 5, 2011 So what to do now? I am just started with PHP Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted July 5, 2011 Share Posted July 5, 2011 true..you will need to wrap you $name argument in quotes... <?php setcookie("Key_my_site", $_POST['pass'], $hour); ?> Also, please post your code if you need help with clearing up the headers errors. Quote Link to comment Share on other sites More sharing options...
rjcfan4ever Posted July 5, 2011 Author Share Posted July 5, 2011 Ok ty but... What they mean with Key_My_Site Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted July 5, 2011 Share Posted July 5, 2011 Ok ty but... What they mean with Key_My_Site I don't fully understand what you are asking...? Quote Link to comment Share on other sites More sharing options...
rjcfan4ever Posted July 5, 2011 Author Share Posted July 5, 2011 The error in line 118 you have solved.. But what did you mean with setcookie("Key_my_site", $_POST['pass'], $hour); What should it come to be? Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted July 5, 2011 Share Posted July 5, 2011 it should be what I previously posted..instead of what you had <?php setcookie(Key_my_site, $_POST['pass'], $hour); ?> it should become <?php setcookie("Key_my_site", $_POST['pass'], $hour); ?> Quote Link to comment Share on other sites More sharing options...
rjcfan4ever Posted July 5, 2011 Author Share Posted July 5, 2011 But what must I fill in Key_My_Site ? Quote Link to comment Share on other sites More sharing options...
TeNDoLLA Posted July 5, 2011 Share Posted July 5, 2011 It will be the name of the cookie you are setting with function set_cookie() -> http://fi2.php.net/manual/en/function.setcookie.php . I suggest you start reading some very simple php tutorials which can be found tons with a simple google search for example. Also keep php manual open and read, read and read more and the hardest part: UNDERSTAND what you read. Quote Link to comment Share on other sites More sharing options...
rjcfan4ever Posted July 5, 2011 Author Share Posted July 5, 2011 Ok, but you have no solution for line 116 or 124? Quote Link to comment Share on other sites More sharing options...
rjcfan4ever Posted July 5, 2011 Author Share Posted July 5, 2011 Oh.. i understand so this must be line 116 setcookie("ID_my_site", $_POST['username'], $hour); and what about line 124? Quote Link to comment Share on other sites More sharing options...
TeNDoLLA Posted July 5, 2011 Share Posted July 5, 2011 Yeah the solution has been already mentioned few times earlier in this thread but here we go once again. // Line 116 setcookie('ID_my_site', $_POST['username'], $hour); // Line 118 setcookie('Key my site', $_POST['pass'], $hour); And the line 124 is just fine as it is. Quote Link to comment Share on other sites More sharing options...
rjcfan4ever Posted July 5, 2011 Author Share Posted July 5, 2011 Ok thanx all for your help Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted July 5, 2011 Share Posted July 5, 2011 line 116 is the same issue as the previous cookie, you need to wrap the cookie name in quotes "" as for line 124...header() As I previously stated, you cannot output any code to the browser before using either the setcookie() or header() functions...none at all.. In order to properly help you with this if you still do not understand how to solve this, please post the code Quote Link to comment Share on other sites More sharing options...
rjcfan4ever Posted July 5, 2011 Author Share Posted July 5, 2011 setcookie("ID_my_site", $_POST['username'], $hour); setcookie("Key_my_site", $_POST['pass'], $hour); What must I fill in into: ID_my_site and Key_my_site? Quote Link to comment Share on other sites More sharing options...
TeNDoLLA Posted July 5, 2011 Share Posted July 5, 2011 What ever you want to name your cookie. Quote Link to comment Share on other sites More sharing options...
rjcfan4ever Posted July 5, 2011 Author Share Posted July 5, 2011 ooh ty Thanx all for your help Quote Link to comment Share on other sites More sharing options...
rjcfan4ever Posted July 5, 2011 Author Share Posted July 5, 2011 I still have the errors Quote Link to comment Share on other sites More sharing options...
rjcfan4ever Posted July 5, 2011 Author Share Posted July 5, 2011 still have: Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\login\login.php:1) in C:\xampp\htdocs\login\login.php on line 116 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\login\login.php:1) in C:\xampp\htdocs\login\login.php on line 118 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\login\login.php:1) in C:\xampp\htdocs\login\login.php on line 124 Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 5, 2011 Share Posted July 5, 2011 There's a BIG sticky post at the top of this forum section that address header errors - HEADER ERRORS - READ HERE BEFORE POSTING THEM http://www.phpfreaks.com/forums/index.php?topic=37442.0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.