From: Tuc at T-B-O-H.N. <ml...@t-...> - 2007-05-23 21:52:10
|
Hi, As with most people, my guestbook is being used for spam. Even though its "hidden until approved", search engines still pick it up. Today I got annoyed at it, so I looked to start adding Captcha to it. (Sorry, I just got distracted. Even though I pulled the page, they are submitting to the cgi directly...So now THATS chmod 000). I first started by changing the reference on Guestbook.html from "AddGuest.html" to "/cgi-bin/AddGuest.cgi". I then copied my AddGuest.html to AddGuesttemplate.html . After the Comments section, I added : <INPUT TYPE=hidden name=crypt value="%CRYPT%"> Please enter the characters in the image below: <INPUT TYPE=text name=co de> <BR> <IMG SRC="%CAPTCHASRC%"><BR> I then created AddGuest.cgi as : #!/usr/bin/perl use Authen::Captcha; my $output_dir = "/my/html/captcha"; my $www_output_dir = "/captcha"; my $db_dir = "/my/cgi-bin/captcha.db"; my $num_of_characters = 7; my $captcha = Authen::Captcha->new( output_folder => $output_dir, data_folder => $db_dir ); my $md5sum = $captcha->generate_code($num_of_characters); undef $file; open (IN,"</my/html/AddGuesttemplate.html"); while (<IN>) { $file .= $_; } close (IN); $file =~ s/%CRYPT%/$md5sum/g; $file =~ s/%CAPTCHASRC%/$www_output_dir\/$md5sum.png/g; print "Content-Type: text/html; charset=iso-8859-1\n\n"; print $file; exit; There are alot of changes to guestbook.pl... 1) add $captcha to the "use vars qw(" 2) put a $captcha=1; under the $line_breaks=1; 3) Add if ($captcha) { require Authen::Captcha; import Authen::Captcha; } under the "if ($mailprog =~ /SMTP:/i )" 4) After the part where it foreach's the input_names to strip_nonprintable I added : if ($captcha) { my $output_dir = "/usr/home/tucobx/html/captcha"; my $www_output_dir = "/captcha"; my $db_dir = "/usr/home/tucobx/cgi-bin/captcha.db"; my $num_of_characters = 7; my $captcha = Authen::Captcha->new( output_folder => $output_dir, data_folder => $db_dir ); if ($inputs{'code'} && $inputs{'crypt'}) { } else { } } Well, the reason there isn't anything in there yet is I did a quick test. I got my captcha out fine, and when I hit SUBMIT, I realized there were parts of the code I never knew ran. It ends up that there are inputs for the fields built right into the CGI. At this point, I've stopped. I really don't know what to do at this point. Personally, I like the nice pretty fancy page I made previously. The starkness of the stuff in form_error bothers me alot. Has any thought be given to another re-write/version of this? What I personally would love to see is that you allow the user to have a template like mine, but maybe even have a bigger replace of %GUESTBOOK_CODE_HERE% where it inserts the input chunk area and can include the captcha if necessary, so that when there is an error, just suck the template back in, and spit all the error info/etc into its midsection. Sorry for such a long first post.... Tuc |
From: <no...@so...> - 2002-03-19 19:10:30
|
Bugs item #531998, was opened at 2002-03-19 11:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=425769&aid=531998&group_id=39625 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Guestbook Initial Comment: Can't seem to get guestbook installed and working at: http://www.thirdmill.com/cgi-bin/guestbook.pl When I submit add guest page I get following response: Application Error An error has occurred in the program Can't Open /home/cust1/1130/html/nmsguestbook/guestbook.html. lck: No such file or directory Why is lck: appending its self to the file name? Le...@th... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=425769&aid=531998&group_id=39625 |
From: SourceForge.net <no...@so...> - 2006-02-05 23:00:48
|
Support Requests item #1424835, was opened at 2006-02-05 18:00 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=425770&aid=1424835&group_id=39625 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Ed_R (rnrcomp) Assigned to: Nobody/Anonymous (nobody) Summary: Guestbook Initial Comment: Was wondering how I could change around to order the field are displayed in the Guestbook and COnfirmation page? Thanks! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=425770&aid=1424835&group_id=39625 |