ruler1
MIS
- Feb 19, 2007
- 89
hmm im not sure how to solve this problem so i thought someone here might have an easy solution. the problem is if someone was to view a page on my site such as mydomain/mypage.php?mode=edit&id=4 it all works great but if someone adds another character right after the last number something like ?mode=edit&id=4' or ?mode=edit&id=4blabla it messes up the page and will bring up the wrong page most of the time
this is the code i have been working with to 'try' and prevent it but i cant figure out how to remove excess characters from being added/eccepted.
any help would be great. thanks
if ( isset($HTTP_GET_VARS[id]))
{
$hubnum = intval($HTTP_GET_VARS[id]);
}
if ( isset($HTTP_GET_VARS[mode]) && $HTTP_GET_VARS[mode] == 'edit')
{
$emode = $HTTP_GET_VARS['mode'];
}
if (!$emode || !$hubnum)
{
message_die(GENERAL_MESSAGE, 'Item_Not_listed');
}
this is the code i have been working with to 'try' and prevent it but i cant figure out how to remove excess characters from being added/eccepted.
any help would be great. thanks
if ( isset($HTTP_GET_VARS[id]))
{
$hubnum = intval($HTTP_GET_VARS[id]);
}
if ( isset($HTTP_GET_VARS[mode]) && $HTTP_GET_VARS[mode] == 'edit')
{
$emode = $HTTP_GET_VARS['mode'];
}
if (!$emode || !$hubnum)
{
message_die(GENERAL_MESSAGE, 'Item_Not_listed');
}