php - How can I stop spam on my custom forum/blog? -


so have custom built forum & blog system of late has been dealing lot of spam. if wordpress use akismet, if different common platform i'm sure i'd find plugin. there kind of static class can download this? using php.

i'd still go akismet, if it. uses outside of wordpress, may have pay fee it, depending on use -- check terms , conditions -- it's option , easy implement in php using api. use api key wordpress.com account access.

basically, grab whichever php client library takes fancy -- use alex potsides' php5 library -- plug in key, , it's handful of lines of code. here's bare bones of validation straight 1 of live sites:

...             if ($akismet)             {                 $akismet->setcommentauthor($name);                 $akismet->setcommentauthoremail($session->userinfo["email"]);                 $akismet->setcommentauthorurl("");                 $akismet->setcommentcontent($sentence);                 $akismet->setpermalink("");                 if($akismet->iscommentspam())                 {                     // store comment mark spam (in case of mis-diagnosis)                     $spam = true;                     // ...                 } ... 

you shove in whichever fields have, , akismet best , returns yay or nay...


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -