Hello im back,
today i need help for php programing…
First i will say you what i want and second i will show you my script to see whats error inside
---------------Description---------------
i have one ini file, one form and php form action. When someone type in form “number” ex. 1000, script is adding(or minus) this value in ini file.
Ex.
ini looks:
name=bojmaliev
money=10000
level=10
And after form submited with number inside 1000 ini looks:
ini looks:
name=bojmaliev
money=11000
level=10
---------------My script---------------
[php]
<?php $user = parse_ini_file("user.ini"); $org = parse_ini_file("org.ini"); $user1 = $user['money']; $org2 = $org['org_money']; if (isset($_POST['donater'])){ $submitdonate = $_POST['donate']; function minus($usermoney, $donate){ $afterusermoney = $usermoney - $donate; return $afterusermoney; } function add($orgmoney, $donate){ $afterorgmoney = $orgmoney + $donate; return $afterorgmoney; } $file1 = fopen("user.ini", "w"); fwrite($user['money'], (minus($user1, $submitdonate))); fclose($file1); } ?> [/php] The problem in my script is: When the form is submited script get the money from the file, then the money are minused from the value from form, and after my user.ini file looks just the minused value, all other is deleted
Thats all
thanks in advance
Bojmaliev