1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP/SQL Problem... Help!

Discussion in 'General Programming Chat' started by milton, Jun 19, 2011.

  1. milton

    milton Regular Member

    Joined:
    May 21, 2010
    Messages:
    271
    Likes Received:
    60
    I have a PHP site trying to write to my SQL database. It is trying to go to name2.php. However, its like it cannot find name2.php which will then executive adding to the directory.

    I get this on the site:


    The server encountered an internal error or misconfiguration and was unable to complete your request.

    and in the log folder, it produces:

    PHP Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0

    Can anyone help with what this means?
     
  2. other_henry

    other_henry Junior Member

    Joined:
    Jun 1, 2011
    Messages:
    107
    Likes Received:
    19
    Occupation:
    Freelance coder, server guy
    Location:
    US
    It looks like you are running old code on a new version of PHP, did you move this script to a different server?

    If you can change the php configuration you can make the changes suggested in the error message. It would probably be better to modify your code so you don't have this problem in the future.
     
  3. BugFixed

    BugFixed Junior Member

    Joined:
    Sep 24, 2010
    Messages:
    130
    Likes Received:
    39
    register_globals is set OFF on your server. You need to avoid of using register_global anyway.

    The problem is on the script file before redirecting to name2.php.
     
  4. milton

    milton Regular Member

    Joined:
    May 21, 2010
    Messages:
    271
    Likes Received:
    60
    I didn't write this code so not sure. How can I modify the code? Can I get someone to do it for me?

    Yeah I recently switched servers...
     
  5. milton

    milton Regular Member

    Joined:
    May 21, 2010
    Messages:
    271
    Likes Received:
    60
    I did change the config to

    session.bug_compat_42 = 1
    session.bug_compat_warn = 0

    but didn't help
     
  6. Jami90

    Jami90 Newbie

    Joined:
    May 19, 2010
    Messages:
    30
    Likes Received:
    4
    Hi,

    for security reasons you shouldn´t do that but u could try it:

    edit your php-file and add this line at the top of the code after the
    PHP:
    <?php
    PHP:
    ini_set('register_globals''on');

    Just open your php-file with an editor like wordpad or the oldschool windows editor. Do not!!! edit this file with Word or smth. like that!

    Hope i could help u :)