Security/$_REQUEST vars... How do you do it?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

This is my first time posting to the list... I hope this question is not too silly, I am definitely not a guru at PHP.

Anyway, in one of my latest projects, I find myself using this bit of code quite a bit:

if((isset($_REQUEST['sub'])) && (!empty($_REQUEST['sub']))) {
	... code here...
}

Can I write a function that would make my life easier? Maybe something like this (not tested):

//////// function security_check():
function security_check($x) {
	$error = false;
	if((isset($x)) && (!empty($x))) {
		$error = false;
		return $error;
	} else {
		$error = true;
		return $error;
	}
}

Or, is it perfectly valid and secure to use @, like so:

	@... code here...

I know that it completely depends on the what one is trying to accomplish in ones scripts, but any guidance and/or suggestions would be greatly appreciated.

Thanks, I really appreciate your time.
Cheers,
Micky
--
¸.·´¯`·.¸¸><(((º>`·.¸¸.·´¯`·.¸¸><((((º>
·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸><((((º>
`·.¸><((((º>¸.·´¯`·.¸¸><((((º>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux