I am trying to incorporate Advanced Login System into my site, but I keep getting errors such as:

Notice: Undefined index: REMOTE_HOST in /my_root_path/htdocs/login.inc.php on line 229

Notice: Undefined index: rmbpw in /my_root_path/htdocs/login.inc.php on line 102

Notice: Undefined variable: _SESSION in /my_root_path/htdocs/login.inc.php on line 51

Notice: Undefined index: HTTP_REFERER in /my_root_path/htdocs/login.inc.php on line 56

There is no problem with the system if I place it straight onto the server "as is". The problems started when I tried to include the main content of the login file as an "inc.php" file.

What I have done is taken the original index.php file of the system and placed
<?php include ('login.inc.php'); ?> so that the login system is included as a separate file. This gives me the file login.php, which has the style of the original site with the login form included in it. I think that maybe some code is conflicting from the original system with the login code.

Sorry about the huge amount of code. Just a note, I have 2 config files. One for the login.php file and one for the login.inc.php file. Could this cause the errors? I have done a lot of research on google the errors given are usually corrected by fixing the (isset($_POST['login'])) to (isset($_GET['login'])). I tried this but it didnt work.

If anyone can help I'd really appreciate this as its been driving me crazy at work for days now! :confused:

Regards
Jp :thumbsup:

Fumigator

02-26-2008, 05:44 PM

Check out this page in the manual (http://us.php.net/manual/en/reserved.variables.php#reserved.variables.server) for info on the two $_SERVER indices that are giving you problems.

The rmbpw index isn't always going to be set but it looks like you're trying to use it whether it's set or not.

Same thing for the variable $_SESSION; you attempt to use it without knowing if it's set or not.

jpmad4it

02-26-2008, 06:35 PM

Check out this page in the manual (http://us.php.net/manual/en/reserved.variables.php#reserved.variables.server) for info on the two $_SERVER indices that are giving you problems.

The rmbpw index isn't always going to be set but it looks like you're trying to use it whether it's set or not.

Same thing for the variable $_SESSION; you attempt to use it without knowing if it's set or not.

Hey, thanks for the input. I will check out that link and see if I can interpret what its trying to say!

So for the variable $_SESSION and index rmbpw, would I need to use something similar to if(!isset('$_SESSION') to determine if they have been set or not? Sorry if there are any mistakes, I'm still a newbie :o

If what I say above is correct, what would I need to do if those variables are not set? Would I just exit; ?

I can turn off these notices using error_reporting(E_ALL ^ E_NOTICE); but its surely best to fix these notices???

regards
Jonathan

jpmad4it

02-27-2008, 12:04 PM

Hmm i'm totally lost with this one. I've fixed a few errors by using the following, for example,