Hi, You could use a function to clean the user input function cleanUserInput($in, $len) { $in = substr(trim($in), 0, $len); $in = preg_replace("/[\r\n]+[\s\t]*[\r\n]+/", "", $in); $in = escapeshellcmd($in); return $in; } For $_POST used I use the function in this way foreach ($_POST as $varname => $value) { $formVars[$varname] = cleanUserInput($value, 60); } Hope this helps -----Original Message----- From: php-objects@xxxxxxxxxxxxxxx [mailto:php-objects@xxxxxxxxxxxxxxx] On Behalf Of Chris Sent: 30 January 2006 02:46 To: php-objects@xxxxxxxxxxxxxxx Subject: How do you make a form unusable by spammers please? Hi all, I'm desperately trying to get a php form to not be used by spammers, I don't want anything to do with javascript or captcha's. Can anyone please let me know what changes I would need to make to the code on the link below? If I can view the *complete* resultant code somehow, that would be great, otherwise I'm not sure where the code goes ;-) Here's the page: http://www.011005.com/230106 Here's the code: http://www.011005.com/230106.phps Any help is very much appreciated. Chris. PHP Data object relational mapping generator http://www.metastorage.net/ YAHOO! GROUPS LINKS Visit your group "php-objects" on the web. To unsubscribe from this group, send an email to: php-objects-unsubscribe@xxxxxxxxxxxxxxx Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. PHP Data object relational mapping generator http://www.metastorage.net/ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-objects/ <*> To unsubscribe from this group, send an email to: php-objects-unsubscribe@xxxxxxxxxxxxxxx <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/