SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/02/2013, 02:19 PM   #11
Cameltoe
High-roller
 
Cameltoe's Avatar
 
Join Date: Apr 2010
Location: Norway
Posts: 1,771
Reputation: 24
Default Re: Mysql Stats [Rep ++]

Quote:
Originally Posted by teomakedonija View Post
.php
Then you should rather ****** around, as this forum is for pawn.

http://www.tizag.com/mysqlTutorial/mysqlfetcharray.php
__________________

Quote:
Originally Posted by Cameltoe View Post
Share the progress so others who are looking for the same also find's their answer.
Quote:
Originally Posted by teomakedonija View Post
ahaha i don't want
Rep++;
Cameltoe is offline   Reply With Quote
Old 04/02/2013, 04:24 PM   #12
teomakedonija
Banned
 
Join Date: Nov 2011
Posts: 405
Reputation: -46
Default Re: Mysql Stats [Rep ++]

Not working :@ BUMP !
teomakedonija is offline   Reply With Quote
Old 04/02/2013, 04:43 PM   #13
Djole1337
Gangsta
 
Join Date: Apr 2012
Posts: 904
Reputation: 303
Default Re: Mysql Stats [Rep ++]

This is not PHP forum.
Go search somewhere else or just learn PHP. www.php.net

php is easy btw.
Djole1337 is offline   Reply With Quote
Old 04/02/2013, 05:15 PM   #14
teomakedonija
Banned
 
Join Date: Nov 2011
Posts: 405
Reputation: -46
Default Re: Mysql Stats [Rep ++]

Who have finished UCP to give me ?
teomakedonija is offline   Reply With Quote
Old 04/02/2013, 06:55 PM   #15
teomakedonija
Banned
 
Join Date: Nov 2011
Posts: 405
Reputation: -46
Default Re: Mysql Stats [Rep ++]

I maked ucp
teomakedonija is offline   Reply With Quote
Old 06/02/2013, 07:58 AM   #16
Cameltoe
High-roller
 
Cameltoe's Avatar
 
Join Date: Apr 2010
Location: Norway
Posts: 1,771
Reputation: 24
Default Re: Mysql Stats [Rep ++]

Quote:
Originally Posted by teomakedonija View Post
I maked ucp
Share the progress so others who are looking for the same also find's their answer.
__________________

Quote:
Originally Posted by Cameltoe View Post
Share the progress so others who are looking for the same also find's their answer.
Quote:
Originally Posted by teomakedonija View Post
ahaha i don't want
Rep++;
Cameltoe is offline   Reply With Quote
Old 06/02/2013, 09:16 AM   #17
teomakedonija
Banned
 
Join Date: Nov 2011
Posts: 405
Reputation: -46
Default Re: Mysql Stats [Rep ++]

ahaha i don't want
teomakedonija is offline   Reply With Quote
Old 06/02/2013, 01:52 PM   #18
Cameltoe
High-roller
 
Cameltoe's Avatar
 
Join Date: Apr 2010
Location: Norway
Posts: 1,771
Reputation: 24
Default Re: Mysql Stats [Rep ++]

Quote:
Originally Posted by teomakedonija View Post
ahaha i don't want
Well then don't expect to get further help if you get stuck with ANYTHING.
__________________

Quote:
Originally Posted by Cameltoe View Post
Share the progress so others who are looking for the same also find's their answer.
Quote:
Originally Posted by teomakedonija View Post
ahaha i don't want
Rep++;
Cameltoe is offline   Reply With Quote
Old 06/02/2013, 01:57 PM   #19
InfiniTy.
High-roller
 
InfiniTy.'s Avatar
 
Join Date: Oct 2012
Location: Romania,Galați
Posts: 1,258
Reputation: 119
Default Re: Mysql Stats [Rep ++]

Quote:
Originally Posted by Cameltoe View Post
Well then don't expect to get further help if you get stuck with ANYTHING.
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 Code:
<?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();
?>
InfiniTy. is offline   Reply With Quote
Old 06/02/2013, 02:20 PM   #20
Cameltoe
High-roller
 
Cameltoe's Avatar
 
Join Date: Apr 2010
Location: Norway
Posts: 1,771
Reputation: 24
Default Re: Mysql Stats [Rep ++]

Quote:
Originally Posted by Adytza. View Post
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 Code:
<?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
__________________

Quote:
Originally Posted by Cameltoe View Post
Share the progress so others who are looking for the same also find's their answer.
Quote:
Originally Posted by teomakedonija View Post
ahaha i don't want
Rep++;
Cameltoe is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tool/Web/Other] [PHP/MySQL] Powerup Stats - Player stats signature generator kelvin22 Tools and Files 43 20/06/2013 11:15 PM
Mysql Stats SanAndreasVille Scripting Help 0 21/04/2012 02:37 PM
MySQL is not saving my Stats. Shockey HD Scripting Help 18 01/03/2012 12:49 PM
Saving stats with mysql Ozz Help Archive 2 11/04/2010 10:26 AM
Loading stats with MySQL ledzep Help Archive 6 29/06/2009 12:48 PM


All times are GMT. The time now is 04:39 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.