Jump to content

Wat does this? GetVar?


Gayner

Recommended Posts

$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?

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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);
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • 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.