ignite Posted May 22, 2007 Posted May 22, 2007 My itemsend just will not work i have uploaded the file several times and still no luck, The problem is that the item receiver gets the event but not the item. Any ideas ? Quote
hamster01 Posted May 23, 2007 Posted May 23, 2007 Re: Itemsend Try posting the part where it actually sends the event and item. Quote
ignite Posted May 23, 2007 Author Posted May 23, 2007 Re: Itemsend $rm=mysql_fetch_array($m); //are we sending it all $_GET['qty']=abs((INT) $_GET['qty']); if($_GET['qty'] == $r['inv_qty']) { //just give them possession of the item mysql_query("UPDATE inventory SET inv_userid={$_GET['user']} WHERE inv_id={$_GET['ID']} LIMIT 1",$c); } else { //create seperate mysql_query("INSERT INTO inventory VALUES ('','{$r['inv_itemid']}',{$_GET['user']},{$_GET['qty']},0);",$c); mysql_query("UPDATE inventory SET inv_qty=inv_qty-{$_GET['qty']} WHERE inv_id={$_GET['ID']} LIMIT 1;",$c); } print "You sent {$_GET['qty']} {$r['itmname']}(s) to {$rm['username']}"; event_add($_GET['user'],"You received {$_GET['qty']} {$r['itmname']}(s) from [url='viewuser.php?u=$userid']{$ir['username']}[/url]",$c,'transfer'); mysql_query("INSERT INTO itemxferlogs VALUES('',$userid,{$_GET['user']},{$r['itmid']},{$_GET['qty']},unix_timestamp(),'{$ir['lastip']}','{$rm['lastip']}')",$c); } } } } else if($_GET['ID']) { $id=mysql_query("SELECT iv.*,it.* FROM inventory iv LEFT JOIN items it ON iv.inv_itemid=it.itmid WHERE iv.inv_id={$_GET['ID']} AND iv.inv_userid=$userid LIMIT 1",$c); if(mysql_num_rows($id)==0) { print "Invalid item ID"; } else if ($_GET['ID']==0) { die("Nono"); } else { $r=mysql_fetch_array($id); Quote
CraigF Posted May 23, 2007 Posted May 23, 2007 Re: Itemsend this should be your whole itemsend.php for v1 <?php /*----------------------------------------------------- -- Fallen-Lands v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.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(); //itemsend if($_GET['qty'] && $_GET['user']) { $id=mysql_query("SELECT iv.*,it.* FROM inventory iv LEFT JOIN items it ON iv.inv_itemid=it.itmid WHERE iv.inv_id={$_GET['ID']} AND iv.inv_userid=$userid LIMIT 1",$c); if(mysql_num_rows($id)==0) { print "Invalid item ID"; } else { $r=mysql_fetch_array($id); $m=mysql_query("SELECT * FROM users WHERE userid={$_GET['user']} LIMIT 1",$c); if($_GET['qty'] > $r['inv_qty']) { print "You are trying to send more than you have!"; } else if( $_GET['qty'] <= 0) { print "You know, I'm not dumb, j00 cheating hacker."; } else if(mysql_num_rows($m) == 0) { print "You are trying to send to an invalid user!"; } else { $rm=mysql_fetch_array($m); //are we sending it all if($_GET['qty'] == $r['inv_qty']) { //just give them possession of the item mysql_query("UPDATE inventory SET inv_userid={$_GET['user']} WHERE inv_id={$_GET['ID']} LIMIT 1",$c); } else { //create seperate mysql_query("INSERT INTO inventory VALUES ('','{$r['inv_itemid']}',{$_GET['user']},{$_GET['qty']});",$c); mysql_query("UPDATE inventory SET inv_qty=inv_qty-{$_GET['qty']} WHERE inv_id={$_GET['ID']} LIMIT 1;",$c); } print "You sent {$_GET['qty']} {$r['itmname']}(s) to {$rm['username']}"; event_add($_GET['user'],"You received {$_GET['qty']} {$r['itmname']}(s) from [url='viewuser.php?u=$userid']{$ir['username']}[/url]",$c); mysql_query("INSERT INTO itemxferlogs VALUES('',$userid,{$_GET['user']},{$r['itmid']},{$_GET['qty']},unix_timestamp())",$c); } } } else if($_GET['ID']) { $id=mysql_query("SELECT iv.*,it.* FROM inventory iv LEFT JOIN items it ON iv.inv_itemid=it.itmid WHERE iv.inv_id={$_GET['ID']} AND iv.inv_userid=$userid LIMIT 1",$c); if(mysql_num_rows($id)==0) { print "Invalid item ID"; } else { $r=mysql_fetch_array($id); print "[b]Enter who you want to send {$r['itmname']} to and how many you want to send. You have {$r['inv_qty']} to send.[/b] <form action='itemsend.php' method='get'> <input type='hidden' name='ID' value='{$_GET['ID']}' />User ID: <input type='text' name='user' value='' /> Quantity: <input type='text' name='qty' value='' /> <input type='submit' value='Send Items (no prompt so be sure!' /></form>"; } } else { print "Invalid use of file."; } $h->endpage(); ?> Quote
ignite Posted May 23, 2007 Author Posted May 23, 2007 Re: Itemsend Yer i tried uploading the normal file before and it still don't work. Quote
hamster01 Posted May 23, 2007 Posted May 23, 2007 Re: Itemsend There may then be something wrong with your database. Quote
ignite Posted May 24, 2007 Author Posted May 24, 2007 Re: Itemsend I can't see what could be wrong Quote
Decepti0n Posted May 28, 2007 Posted May 28, 2007 Re: Itemsend more likely, you changed the item/inventory table Quote
hamster01 Posted May 28, 2007 Posted May 28, 2007 Re: Itemsend Thankyou, as I already said that. There may then be something wrong with your database. Quote
ignite Posted May 28, 2007 Author Posted May 28, 2007 Re: Itemsend Well i have been testing itemsend and i think the problem is only with medical items. Quote
hamster01 Posted May 28, 2007 Posted May 28, 2007 Re: Itemsend Any error associated with this? If so please provide it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.