Jump to content
MakeWebGames

not sure why this wont work


Snatchy
 Share

Recommended Posts

i'm trying to change the send money to send crystals... i just went through and changed all the fields from money to crystals but for some reson i can't get it to go pas the invalid user defined bit at the strat. i didn't alter anyhting that had to do with calling the user id bit so i'm turning to you guys for some help...

Cheers

 

 

<?php

session_start();
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$cm=money_formatter($ir['crystals'],'');
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm,$cm);
$h->menuarea();


$_GET['ID'] = abs($_GET['ID']);
$_POST['crystals'] = abs($_POST['crystals']);
if(!((int)$_GET['ID']))
{
print "[b]Invalid User ID[/b]";
}
else if($_GET['ID'] == $userid)
{
print "[b]Haha, what does sending Gold Nuggets do for yourself anyway?[/b]";
}
else
{
if($_POST['crystals'])
{
if($_POST['crystals'] > $ir['crystals'])
{
print "[b]Die j00 abuser.[/b]";
}
else
{
mysql_query("UPDATE users SET crystals=crystals-{$_POST['crystals']} WHERE userid=$userid",$c);
mysql_query("UPDATE users SET crystals=crystals+{$_POST['crystals']} WHERE userid={$_GET['ID']}",$c);
print "You sent \${$_POST['crystals']} to ID {$_GET['ID']}.";
event_add($_GET['ID'],"You received \${$_POST['crystals']} from {$ir['username']}.",$c);
$it=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$_GET['ID']}",$c) or die(mysql_error());
$er=mysql_fetch_array($it);

mysql_query("INSERT INTO nugxferlogs VALUES ('', $userid, {$_GET['ID']}, {$_POST['crystals']}, unix_timestamp(), '{$ir['lastip']}', '{$er['lastip']}', '')",$c);


}
}
else
{
print "[b] Transfer Gold Nuggets[/b]




 Sending Gold Nuggets
You are sending money to ID: [b]{$_GET['ID']}[/b].

[b]Amnt: [/b]

Latest 5 Transfers
Time User From User To Amount MULTI"; } else { $m=""; }
print "" . date("F j, Y, g:i:s a",$r['nxTIME']) . "{$r['sender']} [{$r['nxFROM']}] {$r['sent']} [{$r['nxTO']}]   \${$r['nxAMOUNT']} ";
}
}
$h->endpage();
?>
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...