MySQL UCP
#1

Hello, So I basically, I took another Cops and Robbers script's UCP (California Cops and Robbers) and thought that I would use it for my Cops and Robbers server (the CCNR script was further developed from the script I'm using). So here is the default "check.php" that checks the login.

Код:
 <?php
	session_start();
	include "koneksi.php";
	if(isset($_SESSION['playername']))
	{
		go('index.php', 'You already logged in.');
	}
	if(!isset($_POST['username'], $_POST['password']))
	{
		go('index.php', 'Please fillout all required forms.');
	}
	else
	{
		$query = $koneksi->prepare("SELECT `level`,`name` from `player` where `name` = ? and `password` = ?");
		$query->execute(array($_POST['username'], strtoupper(hash("whirlpool", $_POST['password']))));
		if($query->rowCount() > 0)
		{
			$data = $query->fetch();
			go('index.php', 'Succesfully logged in.');
			$_SESSION['playername'] = $data['name'];
			$_SESSION['playerlevel'] = $data['level'];
		}
		else
		{
			go('index.php', 'Wrong username or password.');
		}
	}
And here I modified it because the rows had different names of the script I'm using, Then it looks like this. But then I keep getting "Wrong username or password"

Код:
<?php
	session_start();
	include "koneksi.php";
	if(isset($_SESSION['playername']))
	{
		go('index.php', 'You already logged in.');
	}
	if(!isset($_POST['username'], $_POST['password']))
	{
		go('index.php', 'Please fillout all required forms.');
	}
	else
	{
		$query = $koneksi->prepare("SELECT `playerLevel`,`playerName` from `playerdata` where `name` = ? and `password` = ?");
		$query->execute(array($_POST['username'], strtoupper(hash("whirlpool", $_POST['password']))));
		if($query->rowCount() > 0)
		{
			$data = $query->fetch();
			go('index.php', 'Succesfully logged in.');
			$_SESSION['playername'] = $data['name'];
			$_SESSION['playerlevel'] = $data['level'];
		}
		else
		{
			go('index.php', 'Wrong username or password.');
		}
	}
Reply


Messages In This Thread
MySQL UCP - by Melktert - 25.03.2016, 20:26
Re: MySQL UCP - by Melktert - 26.03.2016, 09:37
Re: MySQL UCP - by buburuzu19 - 26.03.2016, 10:20
Re: MySQL UCP - by Melktert - 26.03.2016, 11:21
Re: MySQL UCP - by buburuzu19 - 26.03.2016, 12:02
Re: MySQL UCP - by Melktert - 26.03.2016, 13:30
Re: MySQL UCP - by buburuzu19 - 26.03.2016, 13:44
Re: MySQL UCP - by X337 - 26.03.2016, 14:03
Re: MySQL UCP - by buburuzu19 - 26.03.2016, 14:14
Re: MySQL UCP - by X337 - 26.03.2016, 14:20

Forum Jump:


Users browsing this thread: 2 Guest(s)