Jump to content

Question

Posted

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

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

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

Add: GabiVlg#7760

Edited by GabiVlg
  • 0
Posted

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

  • 0
Posted

In loc de 

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

incearca sa pui

 

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

Am rezolvat multumesc la toti .. panel acela avea sters ceva din login.p.php si nu are rost

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.