Error in Auth.PHP

Results 1 to 10 of 10
  1. #1
    Unknown marcuel is offline
    MemberRank
    Mar 2010 Join Date
    499Posts

    Error in Auth.PHP

    helo guys, i forgot where i get this files, and i configure the config.php my problem is the auth.php


    error
    Warning: mssql_query() [function.mssql-query]: message: Invalid object name 'LoginAttempts'. (severity 16) in C:\xampp\htdocs\GM\config\auth.php on line 48

    Warning: mssql_query() [function.mssql-query]: Query failed in C:\xampp\htdocs\GM\config\auth.php on line 48

    Warning: mssql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\GM\config\auth.php on line 49

    Warning: mssql_query() [function.mssql-query]: message: Invalid object name 'LoginAttempts'. (severity 16) in C:\xampp\htdocs\GM\config\auth.php on line 52

    Warning: mssql_query() [function.mssql-query]: Query failed in C:\xampp\htdocs\GM\config\auth.php on line 52

    Warning: mssql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\GM\config\auth.php on line 53

    the code
    <?php
    require_once('config/config.php');

    session_start();

    if($_POST["txtUsername"] != "" && $_POST["txtPassword"] != "") {

    $loginusername = str_replace("'", "''", $_POST["txtUsername"]); //anti sql injections para nws
    $loginusername = str_replace("</", "&lt/", $_POST["txtUsername"]);
    $loginusername = str_replace("#", "&#35", $_POST["txtUsername"]);
    $loginusername = str_replace("'", "&apos;", $_POST["txtUsername"]);

    $loginpassword = str_replace("'", "''", $_POST["txtPassword"]);
    $loginpassword = str_replace("</", "&lt/", $_POST["txtPassword"]);
    $loginpassword = str_replace("#", "&#35", $_POST["txtPassword"]);
    $loginpassword = str_replace("'", "&apos;", $_POST["txtPassword"]);


    if(isset($loginusername) && isset($loginpassword)){

    $result2=mssql_query("select * from Account
    where UserID='" . $loginusername . "' and Password='" . $loginpassword . "'");


    $num2=mssql_num_rows($result2);
    }

    if($num2 = 1){

    $_SESSION['username']= $loginusername;
    $_SESSION['password']= $loginpassword;
    }
    }

    if (isset($_SESSION['username']) && isset($_SESSION['password'])) {

    $result=mssql_query("select * from Account
    where UserID='" . $_SESSION['username'] . "' and Password='" . $_SESSION['password'] . "'");


    $num=mssql_num_rows($result);

    }


    $IP = $_SERVER['REMOTE_ADDR'];

    $select = mssql_query("SELECT * FROM LoginAttempts WHERE IP = '$IP'");
    $selectrow = mssql_fetch_array($select);
    $LastLogin = $selectrow["IP"];
    $Attempts = $selectrow["Attempts"];
    $selectdiff = mssql_query("SELECT DATEDIFF(n,LastLogin,getdate()) FROM LoginAttempts WHERE IP = '$IP'");
    $selecteddiff = mssql_fetch_array($selectdiff);

    if($num < 1 && $_POST["txtUsername"] != "" && $_POST["txtPassword"] != ""){

    if($LastLogin == ''){
    mssql_query("INSERT INTO LoginAttempts VALUES('$IP', '1', getdate())");

    }

    elseif($LastLogin != ''){
    if($Attempts >= '1' && $Attempts <= '4' && $selecteddiff[0] < '5')
    {
    $Attemps1 = $Attempts + 1;
    mssql_query("UPDATE LoginAttempts SET Attempts='$Attemps1', LastLogin=getdate() WHERE IP='$IP'");
    }

    elseif($Attempts >= '1' && $Attempts <= '4' && $selecteddiff[0] >= '5'){
    mssql_query("UPDATE LoginAttempts SET Attempts='1', LastLogin = getdate() WHERE IP='$IP'");
    }
    }




    $logeado = 2;
    }

    elseif ($num < 1) {
    if($LastLogin == ''){
    $logeado = 0;
    }
    elseif($LastLogin != '' && $Attempts >= '1' && $Attempts <= '4' && $selecteddiff[0] < '5'){
    $logeado = 2;
    }
    elseif($LastLogin != '' && $Attempts >= '1' && $Attempts <= '4' && $selecteddiff[0] >= '5'){
    $logeado = 0;
    mssql_query("DELETE From LoginAttempts WHERE IP='$IP' ");
    }
    elseif($LastLogin != '' && $Attempts == '5'){
    $logeado = 2;
    }
    elseif($LastLogin != '' && $Attempts == '5' && $selecteddiff[0] < '15'){
    $logeado = 0;
    mssql_query("DELETE From LoginAttempts WHERE IP='$IP' ");
    }

    }


    else {

    if($Attempts < '5'){
    $logeado = 1;
    mssql_query("DELETE From LoginAttempts WHERE IP='$IP' ");
    }

    elseif($Attempts == '5' && $selecteddiff[0] >= '15'){
    $logeado = 1;
    $delete = mssql_query("DELETE From LoginAttempts WHERE IP='$IP' ");
    }

    elseif($Attempts == '5' && $selecteddiff[0] < '15'){
    $logeado = 2;
    }

    }

    ?>
    can anybody help me, thanks ahead.


  2. #2
    Account Upgraded | Title Enabled! vjgame123 is offline
    MemberRank
    Jun 2011 Join Date
    PhilippinesLocation
    213Posts

    Re: Error in Auth.PHP

    ithink you need to use this database :) TablasSQLZG.rar

  3. #3
    Unknown marcuel is offline
    MemberRank
    Mar 2010 Join Date
    499Posts

    Re: Error in Auth.PHP

    for what database is that? i use billcrux, tantragm, userlogin, itemserver in sql server

  4. #4
    Account Upgraded | Title Enabled! vjgame123 is offline
    MemberRank
    Jun 2011 Join Date
    PhilippinesLocation
    213Posts

    Re: Error in Auth.PHP

    that is replacing billcrux_phil Tantra and userlogin^^

    i used that one when i got that error and solved it ;)

  5. #5
    Unknown marcuel is offline
    MemberRank
    Mar 2010 Join Date
    499Posts

    Re: Error in Auth.PHP

    tantra = tantragm, am i right?

  6. #6
    Account Upgraded | Title Enabled! vjgame123 is offline
    MemberRank
    Jun 2011 Join Date
    PhilippinesLocation
    213Posts

    Re: Error in Auth.PHP

    yes it is

  7. #7
    Unknown marcuel is offline
    MemberRank
    Mar 2010 Join Date
    499Posts

    Re: Error in Auth.PHP

    so when i replace it to my sql server, i will automatic change the query in my sql server database?

  8. #8
    Account Upgraded | Title Enabled! vjgame123 is offline
    MemberRank
    Jun 2011 Join Date
    PhilippinesLocation
    213Posts

    Re: Error in Auth.PHP

    delete your database and attach the sql's :D

    no queries needed^^

  9. #9
    Unknown marcuel is offline
    MemberRank
    Mar 2010 Join Date
    499Posts

    Re: Error in Auth.PHP

    copy paste right?

    can i change the tantra to tantragm? coz i have some settings that attach to my tantragm database

    same error,nothing happen

  10. #10
    Ronin Dev John is offline
    MemberRank
    Mar 2011 Join Date
    /dev/nullLocation
    382Posts

    Re: Error in Auth.PHP

    You need the databases of ZoneGamerz, this admin panel don't use the database of radiantecf, yagamy or John (me), are differents. Delete your database and use the of Elianmp.



Advertisement