Gayner Posted September 26, 2009 Share Posted September 26, 2009 $item_id = GetVar('item_id', 0, 'int');[/cod]e then it uses it for : [code]$DB->query("INSERT INTO {items_purchased} (item_id, pack_id, group_id, user_id, points_spent, purchase_date) VALUES ($item[item_id], $item[pack_id], $item[group_id], $user_info[user_id], $item[cost], " . TIME_NOW . ")"); what essentially is it doing? Quote Link to comment Share on other sites More sharing options...
Alex Posted September 26, 2009 Share Posted September 26, 2009 GetVar isn't a standard PHP Function, and $item_id isn't even used (from what I can see) in that code at all. Quote Link to comment Share on other sites More sharing options...
redarrow Posted September 26, 2009 Share Posted September 26, 2009 item_id is used $item_id = GetVar('item_id', 0, 'int');[/cod]e then it uses it for : [code]$DB->query("INSERT INTO {items_purchased} (item_id, pack_id, group_id, user_id, points_spent, purchase_date) VALUES ($item[item_id], $item[pack_id], $item[group_id], $user_info[user_id], $item[cost], " . TIME_NOW . ")"); what essentially is it doing? That just a cocky programmer, what i can see, just a way to confuse the person that get the script i think, i think the variable $item_id was misspelled should off been called $item conclusion this part of the code. $item_id = GetVar('item_id', 0, 'int'); << the number off these should match the insert number of variables, if i am correct. The GetVar is another function to set the internal array settings to protect the database off a insert... what i think anyway? Quote Link to comment Share on other sites More sharing options...
448191 Posted September 26, 2009 Share Posted September 26, 2009 Yeah damn those cocky bastards, intentionally trying to confuse us all.. But for real, the best way to find out what something does in absence of documentation is look at the code. Find "function GetVar" in the code somewhere. But if I would have to make an educated guess, you'll find something like this: function GetVar($index, $default = null, $dataType = 'string') { return settype(isset($_GET[$index]) ? $_GET[$index] : $default, $dataType); } Quote Link to comment Share on other sites More sharing options...
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.