PHP - MySQL Login script error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bull1099
    New Member
    • Jul 2007
    • 1

    PHP - MySQL Login script error

    I designed a simple site which has a login for users to access their account page. When i had my files uploaded on a terrible hosting service site, my website I designed was fully functional. I moved my site to this newsit.es host service because it is ten times better but my login script wont work anymore. I believe it has to do with the settings not allowing sessions. Does this sound right?

    I tried hundreds of times and it kept sending me back to the login page. I figured i set up the mysql connection settings wrong but I tested it by designing a simple page which would select all ids from a specific table inside the database and was able to retrieve all of the data.

    Any ideas on how to get by this session login problem?


    Here is the first lines of my login script

    [CODE=php]
    //check that the user is calling the page from the login form and not accessing it directly
    //and redirect back to the login form if necessary
    if (!isset($userna me) || !isset($passwor d)) {
    header( "Location: index.php?pid=1 " );
    }
    [/CODE]


    When I try to login i get the index.php?pid=1 error

    Could this be a mysql settings problem? I have two other sites with this script on two completely different web host services and never had a problem.
    Last edited by ak1dnar; Jul 13 '07, 04:15 AM. Reason: Added [code=php].....[/code] tags
  • dafodil
    Contributor
    • Jul 2007
    • 389

    #2
    Originally posted by bull1099
    I designed a simple site which has a login for users to access their account page. When i had my files uploaded on a terrible hosting service site, my website I designed was fully functional. I moved my site to this newsit.es host service because it is ten times better but my login script wont work anymore. I believe it has to do with the settings not allowing sessions. Does this sound right?

    I tried hundreds of times and it kept sending me back to the login page. I figured i set up the mysql connection settings wrong but I tested it by designing a simple page which would select all ids from a specific table inside the database and was able to retrieve all of the data.

    Any ideas on how to get by this session login problem?


    Here is the first lines of my login script

    //check that the user is calling the page from the login form and not accessing it directly
    //and redirect back to the login form if necessary
    if (!isset($userna me) || !isset($passwor d)) {
    header( "Location: index.php?pid=1 " );
    }



    When I try to login i get the index.php?pid=1 error

    Could this be a mysql settings problem? I have two other sites with this script on two completely different web host services and never had a problem.
    Maybe the web host has different settings you can check their instructions about setting your database... Try that code to other webhost services if that code works then the problem is in the web host.

    Comment

    • ak1dnar
      Recognized Expert Top Contributor
      • Jan 2007
      • 1584

      #3
      Thread title changed.

      Earlier: PHP Login Problem - Think it is MySQL settings problem
      Recent: PHP - MySQL Login script error

      How to use a good thread title

      Thanks !
      Ajaxrand

      Comment

      • ak1dnar
        Recognized Expert Top Contributor
        • Jan 2007
        • 1584

        #4
        Originally posted by bull1099
        I designed a simple site which has a login for users to access their account page. When i had my files uploaded on a terrible hosting service site, my website I designed was fully functional. I moved my site to this newsit.es host service because it is ten times better but my login script wont work anymore. I believe it has to do with the settings not allowing sessions. Does this sound right?

        I tried hundreds of times and it kept sending me back to the login page. I figured i set up the mysql connection settings wrong but I tested it by designing a simple page which would select all ids from a specific table inside the database and was able to retrieve all of the data.

        Any ideas on how to get by this session login problem?


        Here is the first lines of my login script

        [CODE=php]
        //check that the user is calling the page from the login form and not accessing it directly
        //and redirect back to the login form if necessary
        if (!isset($userna me) || !isset($passwor d)) {
        header( "Location: index.php?pid=1 " );
        }
        [/CODE]


        When I try to login i get the index.php?pid=1 error

        Could this be a mysql settings problem? I have two other sites with this script on two completely different web host services and never had a problem.
        Hi bull1099,

        Welcome to TSDN.

        please run a script to check session is enabled or not on the php engine on the server.
        [CODE=php] <?php
        phpinfo();
        ?>
        [/CODE]

        There you will get a section for current config for session. and update the result back to the thread.

        Comment

        Working...