Mysql Stats [Rep ++]
#1

123123123123
Reply
#2

Bump!!!
Reply
#3

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.
Reply
#4

i tested not working :/ i want to make Mysql Statistic of player

BUMP !!!
Reply
#5

with lots knowledge and experience.. (eg. probably not for you)

just kidding just hire someone to do the job xd
Reply
#6

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.
Reply
#7

ok i "fixed" Repped for all
Reply
#8

BUMP! Help please !
Reply
#9

You want PHP or in server ?
Reply
#10

.php
Reply
#11

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_fileFTP_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
Reply
#12

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)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)