Jump to content

Recommended Posts

Posted

Am un panel si am conectat baza de date la el dar cand vreau sa ma loghez imi zice Login failed chiar daca datele sunt bagate corect.

Asa arata pagina de login in html:

 

<?php
if(isset($_SESSION['user'])) Redirect::to('profile');
?>
<div class="pageTitle"><h3>Sign in</h3></div>
<div id="contentMain">
	<div id="contentPage">
		<div class="subPageContainer">
			<div class="subPageContainer">
				<div class="subPageTitleLeft pageTitle">Sign in into your account</div>
			</div>
			<div class="normalContentBox">
				<?php
				if(isset($_POST['Login']))
				{
					if(strlen($_POST['nume']) && strlen($_POST['parola']))
					{ 
						$q = DB::prepare("SELECT `".DB::$tbl->a->id."` FROM `".DB::$tbl->a->tblname."` WHERE `".DB::$tbl->a->name."` = ? AND `".DB::$tbl->a->password."` = ?");
						$q->execute(array($_POST['nume'],md5($_POST['parola'])));
						if($q->rowCount())
						{
							echo '<font color="green"><center>You\'ve been logged with successfuly! Wait for redirect...</center></font><br><br>';
							while($row = $q->fetch(PDO::FETCH_OBJ)) {	
								$_SESSION['user'] = $row->{DB::$tbl->a->id};
								Redirect::to('profile');
							}
						} else {
							echo '<center>Login failed</center><br><br>';
						}
					} else echo '<center><font color="red"><strong>Complete every field!</strong></font></center><br>';
				}
				?>
				<form action="" method="post">
				<table border="0" cellspacing="0" cellpadding="0" width="380" align="center">
					<tbody>
					<tr>
						<td width="80">
							<div class="formLabel"><span class="text">Name</span>: </div>
						</td>
						<td width="300" class="textarea">
							<input name="nume" type="text" class="textarea" id="nume"><br><br>
						</td>
					</tr>
					<tr>
						<td>
							<div class="formLabel"><span class="text">Password</span>: </div>
						</td>
						<td><input name="parola" type="password" class="textarea" id="parola"></td>
					</tr>
					<tr>
						<td colspan="2">
							<br>
							<div align="center"><input class="loginButton" name="Login" type="submit" id="Login" value="Login"></div>
						</td>
					</tr>
					</tbody>
				</table>
				</form>
			</div>
		</div>
	</div>
</div>

 

Cum pot rezolva asta?

  • 1 month later...
Posted

Da-mi config.class ca sa pot vedea din html nu am ce sa vad.

Bot developer (Discord): https://discordapp.com/oauth2/authorize?client_id=584989992481193989&scope=bot&permissions=8

Web Developer (Disponibil pentru proiecte noi, experienta de 3 ani in php, mysql si web design)

Scripter SA:MP (Am reinceput sa lucrez in domeniul acesta pentru a sustine comunitatea de samp dupa o pauza de 2 ani)

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.