Jump to content

3 Errors in login script


rjcfan4ever

Recommended Posts

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 :D

Link to comment
https://forums.phpfreaks.com/topic/241126-3-errors-in-login-script/
Share on other sites

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.

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.

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.

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

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.