Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // nick:isuyanw,score:200
- // isuyanw,200
- if(isset($_GET['test']))
- {
- $_Get = $_GET['test'];
- $Extrair = explode(",", $_Get);
- $Arquivo = "contas/".$Extrair[0].".ini";
- file_Set($Arquivo, "Score", $Extrair[1]);
- }
- function file_Set($filename, $tag, $val){
- $Internal_F = 0;
- if(file_exists($filename)) $Internal_F = 5;
- if(!file_exists($filename)) $Internal_F = 15;
- $Contend = "";
- if($Internal_F == 5)
- {
- $Arquivo = fopen($filename, "r");
- $Conteudo = fread($Arquivo, filesize($filename));
- $linha = explode("\n", $Conteudo);
- for($i = 0; $i != sizeof($linha); $i ++)
- {
- if(!(strpos($linha[$i], $tag) !== false)){
- if(!is_null($linha[$i])) $Contend .= $linha[$i]."\n";
- }
- }
- fclose($Arquivo);
- unlink($filename);
- $Internal_F = 15;
- }
- if($Internal_F == 15){
- $Contend .= $tag."=".$val;
- $Arquivo = fopen($filename, "w");
- fwrite($Arquivo, $Contend);
- fclose($Arquivo);
- }
- return true;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement