Joshua Posted October 24, 2009 Posted October 24, 2009 My race = 4 and the Item Race = 4. But when I try to use it tells me I'm not the right race. i've had this working b4 and i'm not sure wth it isnt working now > < <?php include "globals.php"; global $ir; $_GET['ID'] = abs((int) $_GET['ID']); //Food if(!$_GET['ID']) { print "Invalid use of file"; } else if($ir['race'] != $_GET['item_race']) { print "You aren't the right race to equip this item"; $h->endpage(); exit; } else { $i=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_id={$_GET['ID']} AND iv.inv_userid=$userid"); if(mysql_num_rows($i) == 0) { print "Invalid item ID"; } else { $r=$db->fetch_row($i); if(!$r['effect1_on'] && !$r['effect2_on'] && !$r['effect3_on']) { die("Sorry, this item cannot be used as it has no effect."); } if($r['effect1_on']) { $einfo=unserialize($r['effect1']); Quote
Guest georgelink Posted October 25, 2009 Posted October 25, 2009 hum, i can't find a problem, you should get someone to test it live for you Quote
Dave Posted October 25, 2009 Posted October 25, 2009 Your gonna want to do some de-bugging by yourself but firstly lets improve the script abit The bit of code checking that the item is for the correct class is this... else if($ir['race'] != $_GET['item_race']) { print "You aren't the right race to equip this item"; $h->endpage(); exit; } But in the script you never check if $_GET['item_race'] is actually set? So add above this code else if(!isset($_GET['item_race'])) { print "Script Error, Please go back and click the link again."; $h->endpage(); exit; } If when you try and equip and item now and it comes up with the error i put in the code above you then know it's because your not setting $_GET['item_race'] correctly. You may also want to add this in just for some extra security $_GET['item_race'] = abs((int) $_GET['item_race']); 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.