Jump to content
  • 0

Problema panel bladex


CaLLyPSO

Question

Spoiler

<?php require_once("../_php_includes/_PHP_Conf.inc.php");

if(isset($_SESSION['name']) && isset($_SESSION['password'])){
    Header("Location: ".$php['HTTP_HOST']."/pages/home");
    return 1;
}
if(isset($_POST['login'])) 
{
    $salt      = '';
    $username = mysqli_real_escape_string($DB_H, addslashes($_POST['name']));
    $password = mysqli_real_escape_string($DB_H, addslashes($_POST['password']));
    $hash1 = hash('sha256', $password . $salt);
    $hash = strtoupper($hash1);
    
        
    $dbh = new PDO("mysql:host=localhost;dbname=bigzone", "root", "");

    $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    $stmt = $dbh->prepare("SELECT id, Name, password FROM users 
                WHERE Name = :numele AND password = :parola");

    /*** bind the parameters ***/
    $stmt->bindParam(':numele', $username, PDO::PARAM_STR);
    $stmt->bindParam(':parola', $hash, PDO::PARAM_STR, 40);

    /*** execute the prepared statement ***/
    $stmt->execute();

    /*** check for a result ***/
    $name_id = $stmt->fetchColumn();

    /*** if we have no result then fail boat ***/
    if($name_id == false)
    {
        $msg = "Datele introduse sunt greșite!";
    }
    /*** if we do have a result, all is well ***/
    else
    {
        /*** set the session user_id variable ***/
        $_SESSION['name'] = $username;
        $_SESSION['password'] = $hash;

        echo "
        <script type='text/javascript'>
        <!--
        function Redirect()
        {
            window.location='/panel/';
        }
        setTimeout('Redirect()', 50);
        //-->
        </script>";
    }    
}
?>

<!DOCTYPE html>
<html>

<head>
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <title>Bladex - Autentificare</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Font CSS (Via CDN) -->
    <link rel='stylesheet' type='text/css' href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800'>
    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:400,500,700,300">

    <!-- Theme CSS -->
    <link rel="stylesheet" type="text/css" href="/panel/assets/skin/default_skin/css/theme.css">

    <!-- Admin Forms CSS -->
    <link rel="stylesheet" type="text/css" href="/panel/assets/admin-tools/admin-forms/css/admin-forms.css">

    <!-- Favicon -->
    <link rel="shortcut icon" href="/panel/assets/img/favicon.ico">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
   <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
   <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
   <![endif]-->
</head>

<body class="external-page sb-l-c sb-r-c">

    <!-- Start: Settings Scripts -->
    <script>
        var boxtest = localStorage.getItem('boxed');

        if (boxtest === 'true') {
            document.body.className += ' boxed-layout';
        }
    </script>
    <!-- End: Settings Scripts -->

    <!-- Start: Main -->
    <div id="main" class="animated fadeIn">

        <!-- Start: Content -->
        <section id="content_wrapper">

            <!-- begin canvas animation bg -->
            <div id="canvas-wrapper">
                <canvas id="demo-canvas"></canvas>
            </div>

            <!-- Begin: Content -->
            <section id="content">

                <div class="admin-form theme-info" id="login1">

        

                    <div class="panel panel-info mt10 br-n">
                                                                                        <button type="submit" onclick="window.location.href='/panel'" class="btn btn-primary btn-block" >Mergi la pagina principală</button>

                        <!-- end .form-header section -->
                        
                            <form method="post" action="">
                            <div class="panel-body bg-light p30">
                                <div class="row">
                                    <div class="col-sm-7 pr30">

                                    

                                        <div class="section">
                                            <label for="username" class="field-label text-muted fs18 mb10">Nume din joc</label>
                                            <label for="username" class="field prepend-icon">
                                                <input type="text" name="username" id="username" class="gui-input" placeholder="Care este numele folosit in joc?">
                                                <label for="username" class="field-icon"><i class="fa fa-user"></i>
                                                </label>
                                            </label>
                                        </div>
                                        <!-- end section -->

                                        <div class="section">
                                            <label for="username" class="field-label text-muted fs18 mb10">Parolă</label>
                                            <label for="password" class="field prepend-icon">
                                                <input type="password" name="password" id="password" class="gui-input" placeholder="Care este parola acestui cont?">
                                                <label for="password" class="field-icon"><i class="fa fa-lock"></i>
                                                </label>
                                            </label>
                                        </div>
                                        <!-- end section -->

                                    </div>
                                    <div class="col-sm-5 br-l br-grey pl30">
                                    <?php if(isset($msg)): ?>
        <div class="alert alert-danger" role="alert"><?= $msg ?></div>
        <?php endif; ?>
                                        <h3 class="mb25"> Odată autentificat o să poți să:</h3>
                                        <p class="mb15">
                                            <span class="fa fa-check text-success pr5"></span> Vezi informații despre cont.</p>
                                        <p class="mb15">
                                            <span class="fa fa-check text-success pr5"></span> Faci o reclamație asupra unui jucător.</p>
                                        <p class="mb15">
                                            <span class="fa fa-check text-success pr5"></span> Schimba parola contului tău.</p>
                                        <p class="mb15">
                                            <span class="fa fa-check text-success pr5"></span> Aplici intr-o facțiune anume.</p>
                                    </div>
                                </div>
                            </div>
                        
        
                            <!-- end .form-body section -->
                            <div class="panel-footer clearfix p10 ph15">
                                       <button type="submit" name="login"  class="btn btn-primary btn-block">Autentificare</button>

                            </div>
                            <!-- end .form-footer section -->
                        </form>
                    </div>
                </div>

            </section>
            <!-- End: Content -->

        </section>
        <!-- End: Content-Wrapper -->

    </div>
    <!-- End: Main -->

    <!-- BEGIN: PAGE SCRIPTS -->

    <!-- Google Map API -->
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>

    <!-- jQuery -->
    <script type="text/javascript" src="/panel/vendor/jquery/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="/panel/vendor/jquery/jquery_ui/jquery-ui.min.js"></script>

    <!-- Bootstrap -->
    <script type="text/javascript" src="/panel/assets/js/bootstrap/bootstrap.min.js"></script>

    <!-- Page Plugins -->
    <script type="text/javascript" src="/panel/assets/js/pages/login/EasePack.min.js"></script>
    <script type="text/javascript" src="/panel/assets/js/pages/login/rAF.js"></script>
    <script type="text/javascript" src="/panel/assets/js/pages/login/TweenLite.min.js"></script>

    <!-- Theme Javascript -->
    <script type="text/javascript" src="/panel/assets/js/utility/utility.js"></script>
    <script type="text/javascript" src="/panel/assets/js/main.js"></script>

    <!-- Page Javascript -->
    <script type="text/javascript">
        jQuery(document).ready(function() {

            "use strict";

            // Init Theme Core      
            Core.init();

            // Init Demo JS
            Demo.init();

            // Init CanvasBG and pass target starting location
            CanvasBG.init({
                Loc: {
                    x: window.innerWidth / 2,
                    y: window.innerHeight / 3.3
                },
            });


        });
    </script>

    <!-- END: PAGE SCRIPTS -->

</body>

</html>

si am facut conexiunea corect dar degeaba ..... munca degeaba....image.png.52d7de8c77ebf2b844517ba8b4526416.png

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
Acum 2 ore, CaLLyPSO a spus:
  Reafișează conținuturi ascunse

<?php require_once("../_php_includes/_PHP_Conf.inc.php");

if(isset($_SESSION['name']) && isset($_SESSION['password'])){
    Header("Location: ".$php['HTTP_HOST']."/pages/home");
    return 1;
}
if(isset($_POST['login'])) 
{
    $salt      = '';
    $username = mysqli_real_escape_string($DB_H, addslashes($_POST['name']));
    $password = mysqli_real_escape_string($DB_H, addslashes($_POST['password']));
    $hash1 = hash('sha256', $password . $salt);
    $hash = strtoupper($hash1);
    
        
    $dbh = new PDO("mysql:host=localhost;dbname=bigzone", "root", "");

    $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    $stmt = $dbh->prepare("SELECT id, Name, password FROM users 
                WHERE Name = :numele AND password = :parola");

    /*** bind the parameters ***/
    $stmt->bindParam(':numele', $username, PDO::PARAM_STR);
    $stmt->bindParam(':parola', $hash, PDO::PARAM_STR, 40);

    /*** execute the prepared statement ***/
    $stmt->execute();

    /*** check for a result ***/
    $name_id = $stmt->fetchColumn();

    /*** if we have no result then fail boat ***/
    if($name_id == false)
    {
        $msg = "Datele introduse sunt greșite!";
    }
    /*** if we do have a result, all is well ***/
    else
    {
        /*** set the session user_id variable ***/
        $_SESSION['name'] = $username;
        $_SESSION['password'] = $hash;

        echo "
        <script type='text/javascript'>
        <!--
        function Redirect()
        {
            window.location='/panel/';
        }
        setTimeout('Redirect()', 50);
        //-->
        </script>";
    }    
}
?>

<!DOCTYPE html>
<html>

<head>
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <title>Bladex - Autentificare</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Font CSS (Via CDN) -->
    <link rel='stylesheet' type='text/css' href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800'>
    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:400,500,700,300">

    <!-- Theme CSS -->
    <link rel="stylesheet" type="text/css" href="/panel/assets/skin/default_skin/css/theme.css">

    <!-- Admin Forms CSS -->
    <link rel="stylesheet" type="text/css" href="/panel/assets/admin-tools/admin-forms/css/admin-forms.css">

    <!-- Favicon -->
    <link rel="shortcut icon" href="/panel/assets/img/favicon.ico">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
   <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
   <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
   <![endif]-->
</head>

<body class="external-page sb-l-c sb-r-c">

    <!-- Start: Settings Scripts -->
    <script>
        var boxtest = localStorage.getItem('boxed');

        if (boxtest === 'true') {
            document.body.className += ' boxed-layout';
        }
    </script>
    <!-- End: Settings Scripts -->

    <!-- Start: Main -->
    <div id="main" class="animated fadeIn">

        <!-- Start: Content -->
        <section id="content_wrapper">

            <!-- begin canvas animation bg -->
            <div id="canvas-wrapper">
                <canvas id="demo-canvas"></canvas>
            </div>

            <!-- Begin: Content -->
            <section id="content">

                <div class="admin-form theme-info" id="login1">

        

                    <div class="panel panel-info mt10 br-n">
                                                                                        <button type="submit" onclick="window.location.href='/panel'" class="btn btn-primary btn-block" >Mergi la pagina principală</button>

                        <!-- end .form-header section -->
                        
                            <form method="post" action="">
                            <div class="panel-body bg-light p30">
                                <div class="row">
                                    <div class="col-sm-7 pr30">

                                    

                                        <div class="section">
                                            <label for="username" class="field-label text-muted fs18 mb10">Nume din joc</label>
                                            <label for="username" class="field prepend-icon">
                                                <input type="text" name="username" id="username" class="gui-input" placeholder="Care este numele folosit in joc?">
                                                <label for="username" class="field-icon"><i class="fa fa-user"></i>
                                                </label>
                                            </label>
                                        </div>
                                        <!-- end section -->

                                        <div class="section">
                                            <label for="username" class="field-label text-muted fs18 mb10">Parolă</label>
                                            <label for="password" class="field prepend-icon">
                                                <input type="password" name="password" id="password" class="gui-input" placeholder="Care este parola acestui cont?">
                                                <label for="password" class="field-icon"><i class="fa fa-lock"></i>
                                                </label>
                                            </label>
                                        </div>
                                        <!-- end section -->

                                    </div>
                                    <div class="col-sm-5 br-l br-grey pl30">
                                    <?php if(isset($msg)): ?>
        <div class="alert alert-danger" role="alert"><?= $msg ?></div>
        <?php endif; ?>
                                        <h3 class="mb25"> Odată autentificat o să poți să:</h3>
                                        <p class="mb15">
                                            <span class="fa fa-check text-success pr5"></span> Vezi informații despre cont.</p>
                                        <p class="mb15">
                                            <span class="fa fa-check text-success pr5"></span> Faci o reclamație asupra unui jucător.</p>
                                        <p class="mb15">
                                            <span class="fa fa-check text-success pr5"></span> Schimba parola contului tău.</p>
                                        <p class="mb15">
                                            <span class="fa fa-check text-success pr5"></span> Aplici intr-o facțiune anume.</p>
                                    </div>
                                </div>
                            </div>
                        
        
                            <!-- end .form-body section -->
                            <div class="panel-footer clearfix p10 ph15">
                                       <button type="submit" name="login"  class="btn btn-primary btn-block">Autentificare</button>

                            </div>
                            <!-- end .form-footer section -->
                        </form>
                    </div>
                </div>

            </section>
            <!-- End: Content -->

        </section>
        <!-- End: Content-Wrapper -->

    </div>
    <!-- End: Main -->

    <!-- BEGIN: PAGE SCRIPTS -->

    <!-- Google Map API -->
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>

    <!-- jQuery -->
    <script type="text/javascript" src="/panel/vendor/jquery/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="/panel/vendor/jquery/jquery_ui/jquery-ui.min.js"></script>

    <!-- Bootstrap -->
    <script type="text/javascript" src="/panel/assets/js/bootstrap/bootstrap.min.js"></script>

    <!-- Page Plugins -->
    <script type="text/javascript" src="/panel/assets/js/pages/login/EasePack.min.js"></script>
    <script type="text/javascript" src="/panel/assets/js/pages/login/rAF.js"></script>
    <script type="text/javascript" src="/panel/assets/js/pages/login/TweenLite.min.js"></script>

    <!-- Theme Javascript -->
    <script type="text/javascript" src="/panel/assets/js/utility/utility.js"></script>
    <script type="text/javascript" src="/panel/assets/js/main.js"></script>

    <!-- Page Javascript -->
    <script type="text/javascript">
        jQuery(document).ready(function() {

            "use strict";

            // Init Theme Core      
            Core.init();

            // Init Demo JS
            Demo.init();

            // Init CanvasBG and pass target starting location
            CanvasBG.init({
                Loc: {
                    x: window.innerWidth / 2,
                    y: window.innerHeight / 3.3
                },
            });


        });
    </script>

    <!-- END: PAGE SCRIPTS -->

</body>

</html>

si am facut conexiunea corect dar degeaba ..... munca degeaba....image.png.52d7de8c77ebf2b844517ba8b4526416.png

Parolele din baza de date sunt criptate?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.