Jump to content

Recommended Posts

Posted

Salutare! Am vrut sa imi deschid un panel pentru un server de gta san andreas multiplayer. Am intampinat o problema. La fereastra de login, cand vreau sa la logez nu merge. Introduc datele, apas Login si nu se intampla nimic, doar isi da refresh pagina... Cum as putea sa rezolv? Toate fisierele sunt in regula... 

Uitati link-ul panelului: panel.royalzone.ro

  • Moderators
Posted

La mine spune:

Username sau parola incorecte

Deci de mers, pare sa mearga pana acolo. Fara un cont demo, nu putem trece mai departe.

PHP Developer - Not available for freelancing right now

Daca ai de gand sa postezi la categoria IPB, nu uita sa citesti regulamentul: Link regulament

  • Moderators
Posted

Verifica daca e implementata functia de login sau daca da vro eroare prin log.

PHP Developer - Not available for freelancing right now

Daca ai de gand sa postezi la categoria IPB, nu uita sa citesti regulamentul: Link regulament

  • Moderators
Posted

Functia ce face mai exact dupa ce loginu e ok?

PHP Developer - Not available for freelancing right now

Daca ai de gand sa postezi la categoria IPB, nu uita sa citesti regulamentul: Link regulament

Posted

Uite:

 

<?php
include 'includes/config.php';
if(isset($_POST['username']) && isset($_POST['password'])){
$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string($_POST['password']);
 
$check = get_row("SELECT id FROM users WHERE name='$username' && password='$password'");
if(isset($check['id']))
{
$_SESSION['username'] = $_POST['username'];
$_SESSION['password'] = $_POST['password'];
//mysql_query("UPDATE users SET rpgon=1 WHERE name='$username'");
$id = $check['id'];
header("location: index.php");
}
else
{
$err = 'Username sau parola incorecte';
}
}
 
include 'includes/header.php';
 
?>
 
<div class="main-content">
<div class="page-content">
<div class="row-fluid">
<div class="span12">
<center>
<form method="POST" action="login.php">
 
<h2>RoyalZone.Ro Login</h2>
 
Username:<br />
<input type="text" id="username" name="username" /><br />
Password:<br /> 
<input  id="password" type="password" name="password" /><br />
<br />
<input class="btn btn-inverse btn-large" type="submit" value="Login"><br /><br />
 
 
<?php if(isset($err)): ?>
 
 
<span class="text-error"><?=$err?></span>
 
 
<?php endif; ?>
</table>
</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-->

  • Moderators
Posted

Nu inteleg de ce ai adauga parola in sesiune:

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

Dar na, poate ai nevoie si nu stiu eu.

 

Despre bucata asta, eu am impresia ca codu doar creeaza sesiunea pe username, isi tine in variabila ID-ul de la username si dupa probabil nu e folosit, in index.php ar trebui sa citesti daca exista o sesiune deschisa, si daca da, sa afisezi datele sesiunei, adica ca esti pe contu tau, sa-ti apara numele, etc.

 

Poti sa vezi cum se lucreaza cu datele sesiunei si un exemplu aici:

http://phppot.com/php/php-login-script-with-session/

 

Sau ceva mai basic:

http://www.w3schools.com/php/php_sessions.asp

PHP Developer - Not available for freelancing right now

Daca ai de gand sa postezi la categoria IPB, nu uita sa citesti regulamentul: Link regulament

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.