Jump to content

Putin ajutor login.php


AdY.Capone

Recommended Posts

De cateva zile ma tot chinui sa rezolv login.php

Nu merge sa ma loghez.. id sau pass incorecte. Am pus exact ca din database.. tabel users de unde sa extraga, name si password exact ca in database.. si nimic.

<?php

include 'includes/config.php';

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

    $username = sec($_POST['username']);

    $password = $_POST['password'];

    $check = get_row("SELECT ID FROM users WHERE name='$username' && password='$password'");

    if(isset($check['id'])){

        $banned = get_row("SELECT * FROM bans WHERE name='$username'");

        if(isset($banned['id'])){

            if($banned['BanaP'] == 0){

                $err = 'EÅŸti banat permanent.';

            }else{

                $err = 'EÅŸti banat până la data de '.$banned['BanzP'].'.'.$banned['BanlP'].'.'.$banned['BanaP'].' '.$banned['BanoP'].':'.$banned['BanmP'];

            }

        }else{

            $_SESSION['username'] = $_POST['username'];

            $_SESSION['password'] = $password;

            mysql_query("UPDATE users SET rpgon=2 WHERE Name='$username'");

            header('location: index.php');

        }

    }else{

        $err = 'Numele de utilizator ori parola incorecte.';

    }

}

 

include 'includes/header.php';

 

?>

 

<div class="main-content">

<div class="breadcrumbs" id="breadcrumbs">

<script type="text/javascript">

                        try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}

                    </script>

<ul class="breadcrumb">

<li>

<i class="icon-home home-icon"></i>

<a href="index">Acasă</a>

</li>

<li class="active"><i class="icon-angle-right"></i>

Conectare

</li>

</ul>

 

<div class="nav-search" id="nav-search">

<form method="POST" action="searchplayer">

<span class="input-icon">

<input type="text" placeholder="Caută jucător ..." name="username" id="username" type="submit" class="nav-search-input" autocomplete="on">

<i class="icon-search nav-search-icon"></i>

</span>

</form>

</div>

 

</div>

<div class="page-content">

<div class="row-fluid">

<div class="span12">

<center>

<form method="POST" action="login.php">

        <?php if(isset($err)): ?>

                <center><div class="alert alert-danger"><?=$err?></div></center>

        <?php endif; ?>        

    <h2>Panou Utilizator RPG Respect-Gaming</h2>

        

            Nume de utilizator:<br />

            <input type="text" id="username" name="username" /><br />

            Parola:<br />

            <input  id="password" type="password" name="password" /><br />

            <br />

            <input class="btn btn-inverse btn-large" type="submit" value="Conectare"><br /><br />

            <br>    

            <br>

            <div class="hr hr8 hr"></div>

            <br>

            (&copy;) Respect-Gaming 2014 - Toate Drepturile Rezervate

</form>

</center>

</div><!-- this div closes span12-->

</div><!-- this div close row fluid -->

</div><!-- this div close page content-->

</div><!-- this div close main content-->

Nu am parolele criptate.

Link to comment
Share on other sites

9 hours ago, AdY.Capone said:

scriu print_r dupa $check ?

Știi să folosești fu ctia print_r? 

Pui sub check ala 

print_r($check);

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

5 hours ago, AdY.Capone said:

Array ( [0] => 1 [id] => 1 ) Unknown column 'name' in 'where clause'

Ei bine unknown column name imi aparea mai mereu. Exact asa apare in baza de date(users) name nu Name sau altceva

Scrie SELECT * FROM users in loc de SELECT ID FROM users ce de dupa lasi la fel.

Link to comment
Share on other sites

 

<?php

include 'includes/config.php';

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

    $username = sec($_POST['username']);

    $password = $_POST['password'];

    $check = get_row("SELECT * FROM `users` WHERE `name`='".$username."' AND `password`='".$password."'");

    if(isset($check['id'])){

        $banned = get_row("SELECT * FROM `bans` WHERE `name`='". $username ."'");

        if(isset($banned['id'])){

            if($banned['BanaP'] == 0){

                $err = 'EÅŸti banat permanent.';

            }else{

                $err = 'EÅŸti banat până la data de '.$banned['BanzP'].'.'.$banned['BanlP'].'.'.$banned['BanaP'].' '.$banned['BanoP'].':'.$banned['BanmP'];

            }

        }else{

            $_SESSION['username'] = $_POST['username'];

            $_SESSION['password'] = $password;

            mysql_query("UPDATE `users` SET `rpgon`=2 WHERE `name`='".$username."'");

            header('location: index.php');

        }

    }else{

        $err = 'Numele de utilizator ori parola incorecte.';

    }

}



include 'includes/header.php';



?>



<div class="main-content">

<div class="breadcrumbs" id="breadcrumbs">

<script type="text/javascript">

                        try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}

                    </script>

<ul class="breadcrumb">

<li>

<i class="icon-home home-icon"></i>

<a href="index">Acasă</a>

</li>

<li class="active"><i class="icon-angle-right"></i>

Conectare

</li>

</ul>



<div class="nav-search" id="nav-search">

<form method="POST" action="searchplayer">

<span class="input-icon">

<input type="text" placeholder="Caută jucător ..." name="username" id="username" type="submit" class="nav-search-input" autocomplete="on">

<i class="icon-search nav-search-icon"></i>

</span>

</form>

</div>



</div>

<div class="page-content">

<div class="row-fluid">

<div class="span12">

<center>

<form method="POST" action="login.php">

        <?php if(isset($err)): ?>

                <center><div class="alert alert-danger"><? echo $err; ?></div></center>

        <?php endif; ?>        

    <h2>Panou Utilizator RPG Respect-Gaming</h2>

        

            Nume de utilizator:<br />

            <input type="text" id="username" name="username" /><br />

            Parola:<br />

            <input  id="password" type="password" name="password" /><br />

            <br />

            <input class="btn btn-inverse btn-large" type="submit" value="Conectare"><br /><br />

            <br>    

            <br>

            <div class="hr hr8 hr"></div>

            <br>

            (©) Respect-Gaming 2014 - Toate Drepturile Rezervate

</form>

</center>

</div><!-- this div closes span12-->

</div><!-- this div close row fluid -->

</div><!-- this div close page content-->

</div><!-- this div close main content-->

Asa ar trebui sa functioneze perfect !

Edited by SSYT
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
Reply to this topic...

×   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.