Handle web parameters gracefully in PHP

Published: | by Julian Knight Reading time ~1 min.
📖 Posts | 📎 Development | 🔖 PHP

# Handle web parms (Call as: myParms('report');)
# Ensures that the given parm is always set
function myParms($var) {
	global $$var;
	if(isset($_REQUEST[$var])){
		$$var=$_REQUEST[$var];
	} else {
		$$var='';
	}
}

comments powered by Disqus