Jump to content

Problema Panel

Recommended Posts

Nu stiu daca am voie sa postez aici, in fine.
Am o problema la un panel la login, in baza de date parolele sunt criptate dar in panel cand dai login iti spune ca parola e incorecta, din ce am inteles eu cu mintea mea de gaina e problema de la login.p.php unde codu nu citeste parolele criptate.

V-am lasat codul mai jos, mersi de ajutor.

<?php if(Config::isLogged()) { ?>
$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Succes','You are logged in!','error');}</script>";
$_SESSION['AlertTime'] = time();
<script>window.location.href = '<?php echo Config::$URL  ?>';</script>
<?php die(); } ?>

<?php if(isset($_POST['login'])) {
    $username = Config::antiXSS($_POST['username']);
  $password = Config::antiXSS(md5($_POST['password']));
    $passwordno = Config::antiXSS($_POST['password']);
$timex = time();
    if(!$username || !$password) {
      echo General::alertView("danger","Complete all fields (name / password).");
    } else {
        $kenny = Config::$g_con->prepare('SELECT * FROM `users` WHERE `name` = ? AND `password` = ?');
        if($kenny->rowCount()) {
            $account = $kenny->fetch(PDO::FETCH_OBJ);

if ($checksuspend == 0) { 

unset($_SESSION['pin_session']); // REMOVE SESSION PIN 

$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Succes','You have successfully logged in.','error');}</script>";
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '".Config::$URL ."profile/".$account->name."';</script>";

$_SESSION['login_session'] = $account->id; // ADD SESSION LOGIN

} else { 

if ($suspend->Permanent == 0) { 
if ($suspend->ExpireDate < date('Y-m-d H-i', $timex)) {   

$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Error','Your suspend has expired, congrats!','error');}</script>";
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '".Config::$URL ."profile/".$data->name."';</script>";

$_SESSION['login_session'] = $account->id; // ADD SESSION LOGIN

} else { 

$_SESSION['HomeAlert'] = Config::alertView("danger","You are suspended by ".$suspend->AdminName." for ".$suspend->Days." days. Reason: ".$suspend->Reason.". Expire at: ".$suspend->ExpireDate."!");
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '<?php echo Config::$URL  ?>';</script>";


$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Error','You are suspended by'.$suspend->AdminName.' permanently. Reason: '.$suspend->Reason.The user or password is incorrect','error');}</script>";
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '".Config::$URL ."profile/".$account->name."';</script>";


/* - - - */ 

/* - - - */ 

        echo "<script>setTimeout(myFunction, 10);function myFunction() {swal('Error','The user or password is incorrect','error')};</script>";

              <div style="width: 60%; margin-left:24%;" class="row card has-shadow">
			<div class="col-lg-12">
                    <div class="card-body">
                      <form method="POST">
                        <div class="form-group">
                          <label class="form-control-label">Username</label>
                          <input type="text" class="form-control" name="username" required>
                        <div class="form-group">       
                          <label class="form-control-label">Password</label>
                          <input type="password" class="form-control" name="password" required>
                        <div class="form-group">       
                          <input type="submit" value="Login" class="btn btn-primary btn-block" name="login">
                               <p style="text-align:center;">Forgot your password? Click <a href="<?php echo Config::$URL ?>recovery">here</a>.</p>


Graphic Designer

HTML/CSS/PHP Developer


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.

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.


Background Picker

Template Style Picker

Layout Customizer

Fluid Width

Switch between fixed or fluid width

Sidebar Hide ON/OFF

You can hide or unhide your sidebar whenever you want.

Index Customizer


Sidebar Position

You can choose the position of sidebar, left or right / [ L ] for left, [ R ] for right.


Subforum Columns

You can choose how many columns to display your subforums


Hide/Unhide Back To Top Button

Chose between display block and none [ Y = Show / N = Hide ]

  • Create New...