[pmwiki-users] FW: Captcha

Peter K.H. Gragert p.k.h.gragert at misc.utwente.nl
Mon May 12 02:22:39 CDT 2008


Trying to find a solution for the guestbook you use
I changed it with a captcha usage it looks now as follows:
Picture of test:




 

End of picture

 

First you have to fill in the captcha digits to see the Guestbook input
fields. Then you may ad a message. (only clicking OK of the guestbookform)
If the message contains http:// (any case) nothing is added!!!
Otherwise it is immediately added after "Start of Guestbook".

The changes in guestbook.php are as follows:
------in guestbook.php-------

      $msg = StripCSlashes($_GET['message']);

      if(ereg("http://",$msg)){

        $rcpage = ReadPage($pagename,"");

 

      } else {

        $default = "----";

        $rcpage = ReadPage($pagename,"");

        $pos=strpos($rcpage['text'],"Start of Guestbook");

        $len=strlen("Start of Guestbook");

        $before=substr($rcpage['text'],0,$pos+$len);

        $after=substr($rcpage['text'],$pos+$len);

        $rcpage['text'] = $before.

           /*   "\n$$$$\$default".  pog? */

                "\n\n%green%Posted on ''".strftime($TimeFmt,$Now).

                " by ''".StripCSlashes($_GET["name"])."%%[[<<]]".

 
(($_GET["homepage"])?StripCSlashes($_GET["homepage"]):"")."\n\n". $msg .

                "\n\n----".$homepage. "". $HTTP_GET_VARS["homepage"].

                $after;

      }

        WritePage($pagename,$rcpage);

        Redirect($pagename);

--------end part of guestbook.php

The Guestbook PmWiki source
==================start page======================

!!To go against evil bots

Fill in the captcha, to send a message!\\

(:input form action={*$PageUrl} method=post:)

Enter value: {$Captcha} (:input captcha:)

(:input submit:)

(:input end:)

 

 

----

(:if captcha:)

%green%You may enter a message%%

(:$Guestbook:)

(:else:)

%red%Not allowed%%

(:ifend:)

!!Start of Guestbook

 

%green%Posted on ''12 mei 2008 om 09:09 by ''PKHG%%[[<<]]pepe.cwsurf.de

 

Second try without a www adres

 

----

 

%green%Posted on ''12 mei 2008 om 09:06 by ''Wo kommt dies an?%%[[<<]]

 

Peter war hier!

 

===========end page=================





 

-----Oorspronkelijk bericht-----
Van: pmwiki-users-bounces at pmichaud.com
[mailto:pmwiki-users-bounces at pmichaud.com] Namens Mark Trumpold
Verzonden: zondag 11 mei 2008 20:26
Aan: PmWiki Users
Onderwerp: [pmwiki-users] Captcha

 

Hi All

 

Cam i place a captcha just on one page, eg the guestbook? If so how?

 

The rest of the wiki has an edit password so I dont really need  

elsewhere?

 

Best

 

M

 

_______________________________________________

pmwiki-users mailing list

pmwiki-users at pmichaud.com

http://www.pmichaud.com/mailman/listinfo/pmwiki-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20080512/3186281e/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 26058 bytes
Desc: not available
Url : http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20080512/3186281e/attachment-0001.jpe 


More information about the pmwiki-users mailing list