if(!isset($category_id) || !(int)$category_id>0)
{
$category_id=0;
}
if(!isset($product_id) || !(int)$product_id>0)
{
$product_id=0;
}
if(!isset($remove))
{
$remove="";
}
if(!isset($active))
{
$active="";
}
if(!isset($inactive))
{
$inactive="";
}
if(!isset($action))
{
$action="";
}
...and condense it down too...
foreach(array('remove', 'active', 'inactive', 'action') as $v)
{ if(!isset($$v)) { $$v=''; } }
Writing code is therapeutic. :-)
No comments:
Post a Comment