[PHP/Yini] PHP Yini reading from file
#1

This is function for YINI int reading...
PHP Code:
function YINI_IntGet($filename,$key
    {
        if(
file_exists($filename))
        {
            
$lines file($filename);
            foreach (
$lines as $line
            {
                
$line rtrim($line);
                if(
stristr($line$key."="))
                {
                    
$string str_replace($key."=","",$line);
                }
            }
        }
        else
        {
            return (int)
"";
        }
        return (int)
$string;
    } 
This is code for show file line value:

PHP Code:
ftp_chdir($conn_id"/samp_2700/scriptfiles/Users");
    
$NICK_ $_POST['nick'].".ini";
    if (
ftp_size($conn_id$NICK_) >= 0)
    {
        
ftp_get($conn_id"account"$NICK_,FTP_BINARY);
        echo 
"You are viewing stats of ".$_POST['nick']."<br />";
        echo 
"Player has $".YINI_IntGet(NICK_"Money")." dollars!";
        
unlink($NICK_);
    }
    else 
    {
        echo 
"User ".$_POST['nick']." is not registered!";
    } 
The problem is, when i type my nick, in file i have over $150,000 but i see this

http://i.imgur.com/gxGtz.png

The final problem is that yini save line in format

Code:
Money = VALUE
but my code read's like

Code:
Money=VALUE
my code does not recognize the spacing...
Reply
#2

bump, srry
Reply
#3

LAST chance bump
Reply
#4

This is for PAWN help.
Reply
#5

I understand that, i put in subject [PHP/Yini] and if someone have idea how i can make that my PHP read value BEHIND =_
(_ = Space)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)