Ankündigung

Einklappen
Keine Ankündigung bisher.

Hilfe bei login möchte es mit ajax ausführen hilfe bei ajax script

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Hilfe bei login möchte es mit ajax ausführen hilfe bei ajax script

    Hallo Liebe PhP Forum User brauche hilfe ich möchte gerne ein ajax script haben für mein login system ich suche ein der mir das schreiben kann zahle 10 oder 15 euro paypal für das kleine ajax script


    PHP-Code:
                                                        <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
                                                            <div class="md-form form-sm mb-4">
                                                                <i class="fal fa-user prefix active"></i>
                                                                <input type="text" name="username" id="username" class="form-control">
                                                                <label for="username" class="active"><?php echo LoadLang('#USERNAME#'); ?></label>
                                                            </div>
                                                            <div class="md-form form-sm mb-4">
                                                                <i class="fal fa-key prefix active"></i>
                                                                <input type="password" name="password" id="password" class="form-control">
                                                                <label for="password" class="active"><?php echo LoadLang('#PASSWORD#'); ?></label>
                                                            </div>
                                                            <div class="form-group text-left">
                                                                <div class="custom-control custom-switch">
                                                                    <input type="checkbox" name="remember_me" class="custom-control-input" id="rememberme">
                                                                    <label class="custom-control-label" for="rememberme"><?php echo LoadLang('#LOGIN_REMEMBER#'); ?></label>
                                                                </div>
                                                            </div>
                                                            <div class="text-center mt-1-half">
                                                                <button id="js-login-btn" type="submit" class="btn btn-success mb-2 waves-effect waves-light btn-block"><?php echo LoadLang('#LOGIN#'); ?> <i class="fal fa-send ml-1"></i></button>
                                                            </div>
                                                    </form>

    PHP-Code:
    if(isset($_POST["username"]) AND ($_POST["username"]) != '' AND isset($_POST["password"]) AND ($_POST["password"]) != '' AND (!isset($jails['id']) OR $jails['id'] >! '0')){


            
    $admin mysqli_fetch_array(mysqli_query($mysqli"SELECT id, username, password, lang, salt FROM ".$dbprefix."admin WHERE active != '2' AND username = '".mysqli_real_escape_string($mysqlitrim($_POST["username"]))."' LIMIT 1"));
            if(isset(
    $admin["id"]) AND $admin["id"] > '0'){ $aid $admin["id"]; }else{ $aid '0'; }
            if(isset(
    $admin["username"]) AND ($admin["username"]) != '' AND isset($admin["password"]) AND ($admin["password"]) != ''){

                if(isset(
    $_POST["remember_me"])){$remember_me '1';}else{$remember_me '0';}

                
    $secret_salt $admin["salt"];
                
    $password_salt md5($_POST["password"]);
                
    $salted_password $secret_salt $password_salt;
                
    $password hash('sha256'$salted_password);

                if(isset(
    $admin["password"]) AND trim($admin["password"]) != '' AND $admin["password"] == $password AND isset($_POST["password"]) AND $_POST["password"] != ''){

                    
    $login1 mysqli_query($mysqli"UPDATE ".$dbprefix."admin SET
                    relog           = '"
    .mysqli_real_escape_string($mysqli$remember_me)."',
                    lastip          = '"
    .mysqli_real_escape_string($mysqli$_SERVER['REMOTE_ADDR'])."',
                    lastlogin       = '"
    .mysqli_real_escape_string($mysqli$paneltimestamp)."'
                    WHERE username  = '"
    .mysqli_real_escape_string($mysqli$admin["username"])."'");

                    
    $login2 mysqli_query($mysqli"DELETE FROM ".$dbprefix."admin_sessions WHERE ses_admin = '".mysqli_real_escape_string($mysqli$admin["username"])."' OR ses_id = '".mysqli_real_escape_string($mysqlisession_id())."'");            

                    
    $login3 mysqli_query($mysqli"INSERT ".$dbprefix."admin_sessions SET
                    ses_id          = '"
    .mysqli_real_escape_string($mysqlisession_id())."',
                    ses_admin       = '"
    .mysqli_real_escape_string($mysqli$admin["username"])."',
                    ses_adminip     = '"
    .mysqli_real_escape_string($mysqli$_SERVER['REMOTE_ADDR'])."',
                    ses_start       = '"
    .mysqli_real_escape_string($mysqli$paneltimestamp)."',
                    ses_idle        = '"
    .mysqli_real_escape_string($mysqli$paneltimestamp 3600)."'");

                    if(isset(
    $login1) AND isset($login2) AND isset($login3) AND $login1 == true AND $login2 == true AND $login3 == true){

                        
    $_SESSION["username"]   = $admin["username"];
                        
    $_SESSION['a_lang']     = strtoupper($admin["lang"]);

                        
    mysqli_query($mysqli"INSERT ".$dbprefix."admin_logs SET
                        function    = '"
    .mysqli_real_escape_string($mysqli'login')."',
                        admin       = '"
    .mysqli_real_escape_string($mysqli$_POST["username"])."',
                        adminip     = '"
    .mysqli_real_escape_string($mysqli$_SERVER['REMOTE_ADDR'])."',
                        adminhost   = '"
    .mysqli_real_escape_string($mysqligethostbyaddr($_SERVER['REMOTE_ADDR']))."',
                        time        = '"
    .mysqli_real_escape_string($mysqli$paneltimestamp)."',
                        info        = '"
    .mysqli_real_escape_string($mysqli'Login')."',
                        status      = '"
    .mysqli_real_escape_string($mysqli'1')."'");

                        echo 
    "<meta http-equiv="refresh" content="2URL=/Administrator">";
                        echo
    '<script>toastr["success"]("'.LoadLang('#LOGINOKINFO#').'", "'.LoadLang('#LOGINOK#').'");</script>';
                        require_once(
    ''.$dir.'/'.$target.'/style/'.$adminstyle.'/templates/login.tpl');
                        echo 
    logins($mysqli$paneltimestamp$aid'1'$_SERVER['REMOTE_ADDR'], session_id());



                    }else{
                        echo 
    "ERROR SYSTEM";
                    }
                }else{
                        
    mysqli_query($mysqli"INSERT ".$dbprefix."admin_logs SET
                        function    = '"
    .mysqli_real_escape_string($mysqli'login')."',
                        admin       = '"
    .mysqli_real_escape_string($mysqli$_POST["username"])."',
                        adminip     = '"
    .mysqli_real_escape_string($mysqli$_SERVER['REMOTE_ADDR'])."',
                        adminhost   = '"
    .mysqli_real_escape_string($mysqligethostbyaddr($_SERVER['REMOTE_ADDR']))."',
                        time        = '"
    .mysqli_real_escape_string($mysqli$paneltimestamp)."',
                        info        = '"
    .mysqli_real_escape_string($mysqli'Login')."',
                        status      = '"
    .mysqli_real_escape_string($mysqli'0')."'");
                        echo 
    "<meta http-equiv="refresh" content="2URL=/Administrator">";

                    
    $admin["username"] = $_POST["username"];
                    echo
    '<script>toastr["warning"]("'.LoadLang('#WRONGPASSWORD#').'", "'.LoadLang('#LOGINNOK#').'");</script>';

                    require_once(
    ''.$dir.'/'.$target.'/style/'.$adminstyle.'/templates/login.tpl');
                    echo 
    logins($mysqli$paneltimestamp$aid'0'$_SERVER['REMOTE_ADDR'], session_id());
                }

            }else{
                
    mysqli_query($mysqli"INSERT ".$dbprefix."admin_logs SET
                function    = '"
    .mysqli_real_escape_string($mysqli'login')."',
                admin       = '"
    .mysqli_real_escape_string($mysqli$_POST["username"])."',
                adminip     = '"
    .mysqli_real_escape_string($mysqli$_SERVER['REMOTE_ADDR'])."',
                adminhost   = '"
    .mysqli_real_escape_string($mysqligethostbyaddr($_SERVER['REMOTE_ADDR']))."',
                time        = '"
    .mysqli_real_escape_string($mysqli$paneltimestamp)."',
                info        = '"
    .mysqli_real_escape_string($mysqli'Login')."',
                status      = '"
    .mysqli_real_escape_string($mysqli'0')."'");
                
    //echo "<meta http-equiv="refresh" content="2; URL=/Administrator">";
                
    $admin["username"] = $_POST["username"];
                echo
    '<script>toastr["warning"]("'.LoadLang('#PASSWORD_FORGET_NOK#').'", "'.LoadLang('#LOGINNOK#').'");</script>';
                require_once(
    ''.$dir.'/'.$target.'/style/'.$adminstyle.'/templates/login.tpl');
                echo 
    logins($mysqli$paneltimestamp$aid'0'$_SERVER['REMOTE_ADDR'], session_id());
            }
        } 
    Hoffe einer kann mir helfen


  • #2
    Hallo,

    du hast eine PN.

    Kommentar

    Lädt...
    X