Mysql Stats [Rep ++] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mysql Stats [Rep ++] (
/showthread.php?tid=412297)
Command Help [ REP ++ ] -
teomakedonija - 01.02.2013
123123123123
Re: Mysql Stats [Rep ++] -
teomakedonija - 02.02.2013
Bump!!!
Re: Mysql Stats [Rep ++] -
V1ceC1ty - 02.02.2013
https://sampforum.blast.hk/showthread.php?tid=129183
https://sampforum.blast.hk/showthread.php?tid=391920
https://sampforum.blast.hk/showthread.php?tid=159785
I could go on.
Re: Mysql Stats [Rep ++] -
teomakedonija - 02.02.2013
i tested not working :/ i want to make Mysql Statistic of player
BUMP !!!
Re: Mysql Stats [Rep ++] -
mastermax7777 - 02.02.2013
with lots knowledge and experience.. (eg. probably not for you)
just kidding just hire someone to do the job xd
Re: Mysql Stats [Rep ++] -
DSQLXPRT - 02.02.2013
Follow the links of V1ceC1ty, and if you are talking about a website UCP from the server, learn PHP + MySQL. Or take a MySQL UCP Framework.
Re: Mysql Stats [Rep ++] -
teomakedonija - 02.02.2013
ok i "fixed"

Repped for all
Re: Mysql Stats [Rep ++] -
teomakedonija - 04.02.2013
BUMP! Help please !
Re: Mysql Stats [Rep ++] -
InfiniTy. - 04.02.2013
You want PHP or in server ?
Re: Mysql Stats [Rep ++] -
teomakedonija - 04.02.2013
.php
Re: Mysql Stats [Rep ++] -
Cameltoe - 06.02.2013
Quote:
Originally Posted by Adytza.
I made it.. it's not really ''something'' but.. here you go 
(In folder users you'll need to make a .htaccess with "deny from all" in it.. so you can't access the user files)
PHP код:
<?php
error_reporting(0);
ob_start();
$ftp_server = "ftp server to connect to";
$ftp_user_name = "ftp username";
$ftp_user_pass = "ftp password";
class functions
{
function GetPlayerInfo($user)
{
$file="users/$user.ini";
if(!file_exists($file)) return false;
$data = @parse_ini_file($file);
return $data;
}
}
session_start();
if(!$_SERVER['QUERY_STRING'] && isset($_SESSION['user'])) {
$user = $_SESSION['user'];
$functions = new functions();
$PlayerInfo = $functions->GetPlayerInfo($_SESSION['user']);
if($PlayerInfo == true)
{
echo '<center>';
echo $_SESSION['user'].'\'s profile<BR><BR>';
echo "Level - " .$PlayerInfo['Level']."<br />";
echo "AdminLevel - " .$PlayerInfo['AdminLevel']."<br />";
echo "Money - " .number_format($PlayerInfo['Money'],0,'.','.')."<br />";
echo '<BR><a href="index.php?logout">Logout</a>';
echo '</center>';
}
else
{
echo "Can't show statistics.";
}
}elseif(!isset($_SESSION['user']) && !$_SERVER['QUERY_STRING']) header('Location: index.php?login');
elseif(!isset($_SESSION['user']) && isset($_SERVER['QUERY_STRING']) == 'login') {
if(isset($_POST['submit'])) {
$local_file = 'users/' .$_POST['user']. '.ini';
$remote_file = 'FTP path where users are located/' .$_POST['user']. '.ini';
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
$x = $_POST['user']. ".ini";
if(file_exists($x)) {
unlink($x);
}
echo(!ftp_get($conn_id, $local_file, $remote_file, FTP_BINARY)) ? '<center>Account does not exist.</center>' : false;
ftp_close($conn_id);
$functions = new functions();
$pInfo = $functions->GetPlayerInfo($_POST['user']);
if($pInfo == true)
{
if($_POST['password'] == $pInfo['Key']) {
//echo 'You have successfully logged in.';
$_SESSION['user'] = $_POST['user'];
header('Location: index.php');
} else {
echo '<center>Wrong password.</center>';
}
}
}
?>
<form method="post" class="box style" align="center">
<span class="bold">Name <br /> <input type="text" name="user" /> <br /><br />
Password</span> <br /> <input type="password" name="password" /><br /><br />
<button name="submit">Login</button>
</form>
<?php
}elseif(isset($_GET['logout']) && isset($_SESSION['user'])) {
unset($_SESSION['user']);
header('Location: index.php');
}
ob_flush();
?>
|
I'm not sure if that code works, but i behalf on this forum thanks you for your effort
Re: Mysql Stats [Rep ++] -
InfiniTy. - 06.02.2013
Quote:
Originally Posted by Cameltoe
I'm not sure if that code works, but i behalf on this forum thanks you for your effort 
|
Works.. i tested it

(also he just had a empty database and a connection to it in GM and expecting me to convert his gm into full mysql so that's why it's ini and not mysql)