[Ajuda] UCP login como no SAMP
#1

Estou eu estudando CSS,HTML pra criar um site pro meu servidor...
Atй que nгo estб ficando tгo mal, mas estou com dificuldades com PHP para fazer login ao banco de dados...

Olhando alguns cуdigos eu montei essa base
config.php
Код:
$hostname = 'localhost';
$username = 'root';
$database = 'samp';
$password = '';

$mysql = new mysqli($hostname, $username, $password);
$mysql->select_db($database);
login.php
Код:
<?php
require('config.php');
?>
<html>
<head>
<title> SAMP </title>
</head>
<body>
	<h2>Login</h2>

	<div class="container_login">
	<label><b>Username</b></label>
	<input type="text" placeholder="Enter Username" name="usr" required>
	<br>
	<label><b>Password</b></label>
	<input type="password" placeholder="Enter Password" name="psw" required>
	<br>
	<button type="submit">Login</button>
	</div>
</body>
</html>
Como fazer pra quando apertar o botгo de login fazer isso aqui:
Код:
new Senha[64];
SHA256_PassHash(inputtext,HASH_SENHA,Senha,64);
mysql_format(ConnectMYSQL, query, sizeof(query), "SELECT * FROM accounts WHERE Senha = '%e' AND Username ='%s'", Senha, GetName(playerid));
mysql_pquery(ConnectMYSQL, query, "OnLogin", "d", playerid);
Код:
forward OnLogin(playerid); public OnLogin(playerid) {
	new rows, fields;
	cache_get_row_count(rows);
	cache_get_field_count(fields);
	if(rows) { OnPlayerLogin(playerid); }
	else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Incorrect Password!", "Please enter a correct password in order to log-in\nPress log-in to continue", "Log-in", "Quit"); }
	return 1;
}
Todas as bases em portugues que eu procuro tгo OFF, tentei usar uma, mas nгo tava entendendo com ele fez
Alguйm pode ajudar pra deixar de base pros BRs aqui do fуrum?
Reply


Messages In This Thread
UCP login como no SAMP - by idegod - 09.03.2017, 19:00
Re: UCP login como no SAMP - by GuilhermeNunes - 09.03.2017, 19:05
Re: UCP login como no SAMP - by OtimoJogo - 09.03.2017, 19:58
Re: UCP login como no SAMP - by HoodScript - 09.03.2017, 21:10
Re: UCP login como no SAMP - by pedrotvr - 15.03.2017, 15:22
Re: UCP login como no SAMP - by idegod - 16.03.2017, 18:56
Re: UCP login como no SAMP - by idegod - 24.03.2017, 03:11
Re: UCP login como no SAMP - by RodrigoMSR - 24.03.2017, 03:44

Forum Jump:


Users browsing this thread: 1 Guest(s)