26.02.2014, 07:21
So How do I make a UCP that loads the SAMP Whirlpool plugin, if someone could create the login script, I can do the rest
$password = strtoupper(hash('whirlpool', $password));
<?php
include("config.php");
session_start();
$submit = $_POST['submit'];
$username = sanitize($_POST['Username']);
$password = sanitize($_POST['Password']);
if($submit)
{
if($username && $password)
{
$query = mysql_query("SELECT Username, Password FROM User_Accounts WHERE Username = '".$username."'");
if(mysql_num_rows($query) == 1)
{
while($row = mysql_fetch_assoc($query))
{
$dbusername = $row['Username'];
$dbpassword = $row['Password'];
}
$password = strtoupper(hash('whirlpool', $password));
if($username == $dbusername && $password == $dbpassword)
{
$_SESSION['Username'] = $dbusername;
header('location: home.php');
}
else echo "<br /><br /><span style='color:#ff0000'>Wrong password!</span>";
}
else echo "<br /><br /><span style='color:#ff0000'>Username doesn't exist!</span>";
}
else echo "<br /><br /><span style='color:#ff0000'>Type name and password</span>";
}
?>