Hiya,
As some of you may know what I am doing, and some of you might not, so I will explain what I am doing:
I am building a website, (in php and not using my sql) It will be like www.neopets.com but with an open source (I hope).
So far I have got an accounts system, it is surcure, it uses cookies, and basic password and username authentication, it checks the username and password on every protected page.
I am currently working on a shop and money system,
SO far I have established a system that checks the ammount of money:
<?php
$userlist = file("users.inc.php");
for ($i=1; $i<count($userlist); $i++) {
list($n,$p,$a,$e,$g,$s,$m) = explode(':',chop($userlist[$i]));
if ($n == $user && $m >= 1) {
echo "You have $m<br>";
}
elseif ($n == $user && $m == 0) {
echo "You have no money<br>";
}
}
?>
Now using that above but changing the $m >= 1 to $m >= "the price" to check the money,
what should i put to make it take away the price of the item? and making sure the ammout of money in the users account doesn't go under 0 ?
Everyone who helps on this will have their email addy added to the credits page