Menu

Undefined index: HTTP_USER_AGENT

Help
2004-02-28
2004-02-29
  • David Nelson

    David Nelson - 2004-02-28

    Hullo,

    I just installed phpGedView on my hosted webserver. I can log in OK, but at the top of each page I get the message:

    Warning: Undefined index: HTTP_USER_AGENT in /www.********.***/phpGedView/functions_print.php on line 473

    (*******.*** is my domain name)

    I've tried using Mozilla 1.6 and Internet Explorer 6, but I get the same message in both cases.

    With Mozilla, the page opened, and I managed to configure my site and create the admin user, but I can't log out again.

    With Internet Explorer, I get the message above and then the messages below, after which the page won't display:

    Warning: Undefined index: REMOTE_ADDR in /www.myweblog.cn/phpGedView/authentication_index.php on line 243

    Warning: Cannot add header information - headers already sent by (output started at /www.*******.***/phpGedView/authentication_index.php:243) in /www.*******.***/phpGedView/login.php on line 55

    Could anyone give me an idea what the problem is, and how I can solve it, by any chance?

    With thanks in advance if they can :)

    David

     
    • David Nelson

      David Nelson - 2004-02-28

      It might be useful to add that I'm accessing the Web from behind a VPN. I'm just a node on the VPN.

      I'm using an index database.

      I have cookies enabled.

      I had complications installing a couple of other PHP projects too, but I managed to figure those out.

      Well, here's hoping there's a boffin out there :)

      Thanks, and all the best,

      David

       
      • Phantomas

        Phantomas - 2004-02-28

        which release of PHP is used on your webspace?

         
        • David Nelson

          David Nelson - 2004-02-28

          Oh, and my version of PhpGedView is v2.65.3 final

           
    • David Nelson

      David Nelson - 2004-02-28

      The PHP release is 4.1.3

      MySQL is 3.23.39

      The web server is Zeus/4.2

       
    • Phantomas

      Phantomas - 2004-02-29

      Hi David,

      normally PGV should work with PHP > 4.1 but maybe it could be a problem with the following on your server:

      file: functions_print.php
      Line: 559
      if (strstr($_SERVER["HTTP_USER_AGENT"], "IE")) print "<style type=\"text/css\">\nFORM { margin-top: 0px; margin-bottom: 0px; }\n</style>\n";

      Try to upgrade your PHP to a newer one or try to change the functions.php at line 559 (or search for the string $_SERVER["HTTP_USER_AGENT"] inside your file) to

      if (strstr($HTTP_USER_AGENT, "IE")) print "<style type=\"text/css\">\nFORM { margin-top: 0px; margin-bottom: 0px; }\n</style>\n";

      Maybe it works for you.

      bye, Kurt

       
    • David Nelson

      David Nelson - 2004-02-29

      Hi Kurt :)

      Thanks for your kind help :) Unfortunately that didn't work for Mozilla insofar as the message is just the same. With IE, I get the same message, but then the login page opens normally as within Mozilla. I.e. each page has the following message at the top of the page:

      Warning: Undefined variable: HTTP_USER_AGENT in /www.******.***/phpGedView/functions_print.php on line 475

      (now line 475, because of the edit I indtroduced for your modificaiton)

      With IE, after I log-in and press the button, I then get the messages:

      Warning: Undefined index: REMOTE_ADDR in /www.myweblog.cn/phpGedView/authentication_index.php on line 243

      Warning: Cannot add header information - headers already sent by (output started at /www.*******.***/phpGedView/authentication_index.php:243) in /www.*******.***/phpGedView/login.php on line 55

      With Mozilla, the login page displays, but I can't login. It just brings me back to the same page all the time.

      To enable you to take a look, the site is at:

      http://www.myweblog.cn/phpGedView

      You wouldn't happen to have any other ideas would you per chance? I shall ask my hosting provider to upgrade the PHP.

      In any case, many thanks for your brain power :)

      David

       
    • David Nelson

      David Nelson - 2004-02-29

      I didn't undo the edits as yet, so you could take a look if you wanted to. Plus I unprotected the directory (is that wise?0

       
    • Anonymous

      Anonymous - 2004-02-29

      Hi David,

      Take a look at this thread:
      https://sourceforge.net/forum/message.php?msg_id=2320680

      It is a long one with the exact problems you have.

      Regards,

      Roland

       
      • Phantomas

        Phantomas - 2004-02-29

        Hi David,

        as I see your problem seems to be the version of PHP you are using :-(

        After you changed HTTP_USER_AGENT you get the error with REMOTE_ADDR.

        In this case you would also need to change the source from $_SERVER["REMOTE_ADDR"] to $REMOTE_ADDR etc.

        If you need more help after you read the threath Roland wrote you, we can continue the discussion about what you need to change if your provider doesn't update to a newer version of PHP :-)

        But I think that would be the best solution...

        bye, Kurt

         

Log in to post a comment.