Jump to content

I just canna figure out what up... (simple too!)


xoligy

Recommended Posts

Ive been trying to figue out whats up with this for nearly an hr and so far ive got nowhere im really stumped on this. Basically im entering an amount ot add so lets say 1k so i enter "1000" press enter and get "Numbers Only!'" since when wasn't "1000" numbers ???

 

 

if ($putmoney)
{
// pinoywebdev add s
$id = cln($id);
// pinoywebdev add e
$pimp = mysql_fetch_array(mysql_query("SELECT pimp, trn, money FROM $tab[pimp] WHERE id='$id'"));
$bank = mysql_fetch_array(mysql_query("SELECT pimp, money FROM $tab[bank] WHERE id='$id'"));
$md = ($maxdep) ;

if($deposit > $pimp[2]) {
echo "<html><body><script language=javascript1.1>alert('You do not have that much money!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>";
}
elseif(!preg_match ('/^[0-9][0-9]*$/i', $deposit)) {
echo "<html><body><script language=javascript1.1>alert('Numbers Only!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>";
} 
elseif($deposit <= 0) {
echo "<html><body><script language=javascript1.1>alert('Please enter a positive ammount!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>";
}
elseif($deposit > $maxdep) {
echo "<html><body><script language=javascript1.1>alert('You can not deposit more than the maximum amount!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>";
}
elseif($deposit + $bank[1] > $md) {
echo "<html><body><script language=javascript1.1>alert('You can not deposit more than the maximum amount!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>";
}

elseif($pimp[1] < $depositturns) {
echo "<html><body><script language=javascript1.1>alert('You do not have enough turns to deposit.');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>";
}
else {
// pinoywebdev add s  
$depositturns = cln($depositturns);
$deposit = cln($deposit);
// pinoywebdev add e
mysql_query("UPDATE $tab[bank] SET money=money + $deposit WHERE id='$id'");
mysql_query("UPDATE $tab[pimp] SET trn=trn - $depositturns, money=money-$deposit WHERE id='$id'");
echo "<html><body><script language=javascript1.1>alert('Money Deposited');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>";
report("deposited " . commas($deposit) . "$ to the bank");
}
}

Whats the type of collumn that your using to store said data? I'd use an int. Also, if you have anything like "mysql_real_escape_string" i know that sometime improperly configured it can escape stuff that shouldn't be.

 

And, what is returning the error. MYSQL or PHP?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.