Serious PHP question
#1

Код:
$data = parse_ini_file($file);
Will this only load if the file is .ini? Because i am saving accounts as .acc and now i can't login to the UCP.
Reply
#2

Yes, it only parses (.)ini (initialization) files.
Reply
#3

What do i have to change it to if i use .acc?
Reply
#4

$data = parse_ini_file('users/user.acc'); ??


PHP код:

$ini_array 
parse_ini_file("user.acc"true);
print_r($ini_array); 
something like that
Reply
#5

Quote:
Originally Posted by titanak
Посмотреть сообщение
$data = parse_ini_file('users/user.acc'); ??


PHP код:

$ini_array 
parse_ini_file("user.acc"true);
print_r($ini_array); 
something like that
No it doesn't work

Here is the whole part

Код:
	function GetPlayerInfo($user)
	{
		require "config.php";
		$file="$GameDir/scriptfiles/accounts/$user.acc";
		if(!file_exists($file)) return false;
		$data = parse_ini_file($file);
		return $data;
	}
Reply
#6

why are you using: $file="$GameDir/scriptfiles/accounts/$user.acc";

$ before the user.acc and before the GameDir ?

Try:

PHP код:

    
function GetPlayerInfo($user)
    {
        require 
"config.php";
        
$file="$GameDir/scriptfiles/accounts/"$user.".acc";
        if(!
file_exists($file)) return false;
        
$data parse_ini_file($file);
        return 
$data;
    } 
and also if you got gamedir too a var so use:

PHP код:
    function GetPlayerInfo($user)
    {
        require 
"config.php";
        
$file""$GameDir."/scriptfiles/accounts/"$user.".acc";
        if(!
file_exists($file)) return false;
        
$data parse_ini_file($file);
        return 
$data;
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)