[wp-testers] Contact forms

fullo ffullone at gmail.com
Wed Sep 13 20:38:28 GMT 2006


you should use the akismet.php class

like

include (TEMPLATEPATH . "/inc/akismet.php");
			
$_POST['name'] = preg_replace("|[^a-z0-9 \-.,]|i", "", $_POST["name"]);
$_POST['url'] = preg_replace("|[^a-z0-9 \-.,]|i", "", $_POST["url"]);
$_POST['email'] = preg_replace("|[^a-z0-9 at .]|i", "", $_POST["email"]);
$_POST['msg'] = strip_tags($_POST['msg]);

$akismet = new Akismet( bloginfo('url') , get_option('wordpress_api_key') );
$akismet->setCommentAuthor($_POST['name']);
$akismet->setCommentAuthorEmail($_POST['email']);
$akismet->setCommentAuthorURL($_POST['url']);
$akismet->setCommentContent($_POST['msg']);
$akismet->setPermalink('');

if($akismet->isCommentSpam())
{
 // error msg, this is spam!
}
else
{
   mail() //send the mail
}


On 9/13/06, Ryan Duff <ryan at ryanduff.net> wrote:
> fullo wrote:
> >> Why noy implement a graphical confirm ?
> >
> > or why not add the akismet support...
> >
>
> Is there an API for akismet that we can plug in to? This was on my
> wishlist, but I haven't taken the time to see if it was feasible or not.
> If so it would be GREAT!
>
> --
> Ryan Duff
> http://ryanduff.net
> AIM: ryancduff
> irc.freenode.net #wordpress #plogger
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers
>


-- 
Francesco Fullone
nulla è impossibile per chi non lo deve fare!
mail ffullone at gmail.com ------ icq 13515051
homepage            http://www.fullo.net/blog/


More information about the wp-testers mailing list