i'm getting this even using 'isset':
Notice: Undefined index
it's giving the error at:
returnifisset($_COOKIE["miceusername"], ' value="', '"');
even though i am checking if the cookie isset or not. The function is:
function returnifisset($variable, $first = '', $last = ''){
if(isset($variable) and !empty($variable)){ return $first.$variable.$last; }
}
how i should modify this function to make it work and not give that error!
printifisset(isset($COOKIE["miceusername"], ' value="', '"');)which totally defeats the purpose of using the function at all. My suggestion is to skip the function altogether as it is rather unnecessary and the savings you get from typing it in full are minimal if any at all.returnifissetsubstitute the code within the function. Also, just to make sure you know: Calling return fromreturnifissetwould not return a value for the calling context. You would have to usereturn returnifsset('...','...','...');if you wanted that.