Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Application and Web Development > HTML, XML, Javascript, AJAX

Reply
 
LinkBack Thread Tools Display Modes
Old 03-12-2006, 12:14 PM   #1 (permalink)
ChefFrank
Code Monkey
 
ChefFrank's Avatar
 
Join Date: Mar 2006
Location: Woodbury, CT
Posts: 38
ChefFrank is on a distinguished road
Send a message via Yahoo to ChefFrank
Question Filtering out HTML/IMG/vB code in Guestbook Entries

Lately, I've been plagued with a number of spurious entries in my guestbook, advertising everything from "low, low, mortgage rates", to "increase length, girth and volume". At least they give me props for "a well designed website" and promise to "come on your site often". However, they always leave a link to some website, none of which are food related, which is what my site is about.

I'm running the 'standard' Perl guestbook (from Matt's Free Scripts), and the engine itself is actually built-in to the server - one of the benefits of my domain host is that they actually have all the work done for me - just copy the HTML code into my page, and it works! I would like to build a pre-processor that would either eliminate any links in the text section, or, just simply tell the user that the entry is not allowed.

I had thought about building a table of IP addresses or emails from the Guestlog that are originating these messages, but there isn't any pattern to where they're coming from.

Anyone got a routine that will scan a block of text, and either sanitize it and return the clean text, or return a value of 'good or bad' that I can then use to control the correct action (accept or reject text)?

Frank
ChefFrank is offline   Reply With Quote
Old 03-12-2006, 01:19 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
you get those entries from bots. people want to place links to their site for search engine optomization. you could look around for a guestbook with an image verification. most bots can't read an image, so it would probably prevent a lot of those entries.

my advice would be to just get rid of the guestbook all together. you have forums and chat that people can interact with. guestbooks are a bit dated.
sde is offline   Reply With Quote
Old 03-12-2006, 01:44 PM   #3 (permalink)
ChefFrank
Code Monkey
 
ChefFrank's Avatar
 
Join Date: Mar 2006
Location: Woodbury, CT
Posts: 38
ChefFrank is on a distinguished road
Send a message via Yahoo to ChefFrank
Yeah - that thought has crossed my mind, too . . . .

I did some checking, and found that there's version of the Perl Script that has this capability built in - there's a variable that won't allow HTML in the text. However, it may take some time before my host decides to install it. I may just install the Perl part in my cgi-bin directory and run from there instead of the version on my host's cgi-sys.

If anyone has a script though, I'd still be interested in looking at it just to see how it's done - I can do it in a couple of other languages, but nothing that would run on my host and has a CGI interface.

Frank
ChefFrank is offline   Reply With Quote
Old 03-18-2006, 12:43 AM   #4 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
If you post image generating portion of the perl code I can try to help you understand it / convert it to php.

Also, I agree with sde, guest books are very 90's. Blog style comment sections are all the rage these days. You could do cool stuff by having comments at the bottom of each recipe page.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 03-18-2006, 07:17 AM   #5 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 746
DJMaze is on a distinguished road
http://opensourcecms.com/
DJMaze is offline   Reply With Quote
Old 03-22-2006, 10:17 AM   #6 (permalink)
ChefFrank
Code Monkey
 
ChefFrank's Avatar
 
Join Date: Mar 2006
Location: Woodbury, CT
Posts: 38
ChefFrank is on a distinguished road
Send a message via Yahoo to ChefFrank
Thanks - I pretty much killed the guestbook. The Perl part of the code is actually under the control of my host, and while I could have put a version in my own cgi-bin directory, why bother?

I'm looking at the response to each page approch though. I have enough models about to try to figure it out myself. If I get stuck, I'll be back!!!

Thanks!

Frank
ChefFrank is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how the servlet will integrate the LDAP code j.gohel Java 19 04-16-2005 01:55 AM
Cisco Code breaking sde Code Newbie News 0 05-21-2004 08:10 AM


All times are GMT -8. The time now is 03:38 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting