^ My thoughts exactly. This function will never return true... and why on earth are you still using quotes around the variables? Even if this is just for learning purposes, at least "teach" people right. function mysqlQuiery($sql){ $query = mysql_query($sql) or die(mysql_error()); return $query; } PHP: mysqlQuiery? Come on... you're not even trying, are you? I first thought this was a typo, but the description says it too, lol. Ah well... The whole class you posted there is the most pointless piece of code I've ever seen. You should also write your class in PHP 5.. and not 4 (PHP 4 officially died more than a half year ago). And improve the error handling... ... WTF? Lol... why don't you just add a space to the expression rather than exploding the string and checking each chunk? And what if there was a 5000 word text... you'd run 5000 regular expressions? Wow... Even if you wanted to use your method, how about doing it this way: if(!ereg("^[_A-Za-z0-9/\]+$", $val)){ return false } PHP: ... there could be an invalid chunk right at the beginning, and you'd still run regular expressions for all the other ones (unnecessarily, of course...) .... whhhaaaaat?! This is one of the most confusing and worst structured parts of the whole code. If the first expression matches but the second doesn't, it returns null. And I really fail to see what any of this has to do with URLs? Regular expression to see if there's a space in the string? ... so %%%%%@%%%%.com is a valid email address? And these millions of dirty if/else statements. Do it just this way: function foo($bar) { return preg_match('~[regex]~', $bar); } PHP: Use PREG_MATCH instead of eregi()... the ereg_* functions are about 6 times SLOWER than the preg_* functions. I hope no one actually plans on using this, errr.... "framework". IF you really want to reinvent the wheel, at least do it right. No one wants this crap.
Okay, I don't know how to put it so you actually understand... I wasn't trying to help improving it, but pointing out how crappy and pointless the whole thing is. Let's face it: - No one is interested in this "framework". - Your level of programming and experience isn't high enough to create a useful application like this. - No one is gonna help you, because it's pointless and a waste of time. We (or "the others") would have to spend a great amount of time just fixing the code YOU'VE previously provided. In other words, YOU'RE ALONE!