note 87843 deleted from function.preg-match by thiago

From: Date: Fri, 26 Dec 2008 12:04:50 +0000
Subject: note 87843 deleted from function.preg-match by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-148520@lists.php.net to get a copy of this message
Note Submitter: Pete ---- I have read through so many tutorials etc but this just isnt working. Can somone explain why this wont work?: Trying to check that user input just contains characters and no numbers. To start with. Then would like to make sure they dont use % . / @ etc so they cant inject sql. Here is what I try to use : <code> $name = $_POST['name']; if(preg_match('/[a-z][^0-9]/', $name)) { echo $name; } else { echo 'error'; } </code>

« previous php.notes (#148520) next »