is there a bether way to do this? (checking for empty variables..)
function validateEmpty($theinput,$description = '') { if (empty($theinput)) { $this->errors[] = $description; return false; } else { return true; } }
That looks to be about the simplest way. Why would it need to be any simpler if it works? 🙂
Cheers,
Ryan Jones
thanks 🙂 but was not thinking of simplesity, let me refrase my question 😉
Is it a more secure way of checking this i should know of, to awoid certian SQL injections and other attacks..
thanks in advance
What do empty variables have to do with sql injection?
Plasma wrote:What do empty variables have to do with sql injection?
Nothing, injections normally occur when peope use eval or by putting unescaped, unprocessed strings directly into a MySQL query. If your looking toi avoid exploits you'll need things like addslashes etc.