Jump to content
  • 0
Narcis

problema panel

Question

Salut am o problema la panel mai exact la login 

scriu user si pass si nu ma logheaza pe panel.

am adaugat niste poze din panel cu problema

site www.rzc.ro/panel

cum as putea sa rezolv problema?

asta este codul de la login.p.php

<?php
if(!defined('rpg'))
	die('Nope.');
?>
<title>Login - Blumix</title>
<body class="login_wrapper">
	<div class="form-box login_box" id="login-box">
		<div class="header bg-red" style="font-size: 1.3em;">Welcome to Blumix! <br> Please type your account below.</div>
		<form action="" method="post">
		<fieldset>
		<div class="body bg-gray">
			<?php
			$count[0] = 0;
			$count[1] = 0;
			if(isset($_SESSION['user'])) header('Location: ' . $_PAGE_URL . 'profile/'.$_SESSION['user'].'');
			if(isset($_POST['submit'])) {
				if(!$_POST['username_'] || !$_POST['password_']) {
					echo '<div class="alert alert-danger alert-dissmisible" style="margin-left: 0px">Invalid username or password.<br>Please try again.</div>';
				} else {
		                $q = Config::$g_con->prepare('SELECT * FROM `users` WHERE `name` = ? AND `password` = ?');
		                $q->execute(array($_POST['username_'],hash( 'md5', $_POST['password_'])));
					$count = 0;
					if($q->rowCount())
					{
						$row = $q->fetch(PDO::FETCH_OBJ);
						$d = Config::$g_con->prepare('SELECT * FROM `suspended` WHERE `user` = ?');
						$d->execute(array($row->id));
						while($rowd = $d->fetch(PDO::FETCH_OBJ)) {
							if((strtotime($rowd->stime) - strtotime(date('Y-m-d'))) > 0)
							{
								$count++;
								echo '<div class="alert alert-danger alert-dissmisible" style="margin-left: 0px">This account is suspended until <b>'.$rowd->stime.'</b> by reason: <b>'.$rowd->reason.'</b>.</div>';
							}
						}
						if(!$q->rowCount() || $count == 0)
						{
							$_SESSION['user'] = $row->id;
							echo '<div class="alert alert-success" style="margin-left: 0px">You have successfully logged in. You will be redirected in <b>3</b> seconds.</div>';
							echo '<meta http-equiv="refresh" content=" 3;' . Config::$_PAGE_URL . 'profile/'.$_SESSION['user'].'">';
						}
					}
					else echo '<div class="alert alert-danger alert-dissmisible" style="margin-left: 0px">Invalid username or password.<br>Please try again.</div>';
				}
			}
			?>
			<div class="form-group">
				<input name="username_" type="text" class="form-control" placeholder="Username">
			</div>
			<div class="form-group">
				<input name="password_" type="password" class="form-control" placeholder="Password">
			</div>
		</div>
		<div class="footer">                                                               
			<button type="submit" name="submit" class="btn bg-red btn-block">Log in</button>  
		</div>
		</fieldset>
		</form>
	</div>
</body>

 

login.png

login 1.png

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Pai, dupa instict intreb asa, parolele sunt hasurate?, sau gm este bine configurat pentru panel?

Add: GabiVlg#7760

Edited by GabiVlg

Share this post


Link to post
Share on other sites
  • 0

Panel e in regula merge tot pe el , doar login nu merge ramane blocat , daca scriu user si pass gresit imi apare "Invalid username or password.
Please try again."

image.png.23b362f49703f08d1ab9d640e81fd015.pngimage.png.3d9aba77607a29f54355a34be6c6fb34.pngimage.png.23b362f49703f08d1ab9d640e81fd015.png

Share this post


Link to post
Share on other sites
  • 0

In loc de 

$q->execute(array($_POST['username_'],hash( 'md5', $_POST['password_'])));

incearca sa pui

 

$q->execute(array($_POST['username_'],$_POST['password_']));

Share this post


Link to post
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.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

This site uses cookies. By continuing browsing, you agree to the use of this information. For more details, see Terms of Use and Privacy Policy.