473,405 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

form-checkers to filter "link-spamming"

Hi,

I've designed my own form checking code for name, address, email, comment
box etc.
What my client keeps getting in his consumer feedback forms is "spam" from
companies who
repeatedly insert their hyperlinks in all fields, of course along with their
"hype"...

Is is possible with Javascript to refuse form contents whose strings contain
URL's?
(or would this involve reg ex which I've got a total mental block against?
:)
Claude
Jan 19 '06 #1
12 1883

Claude wrote:
Hi,

I've designed my own form checking code for name, address, email, comment
box etc.
What my client keeps getting in his consumer feedback forms is "spam" from
companies who
repeatedly insert their hyperlinks in all fields, of course along with their
"hype"...

Is is possible with Javascript to refuse form contents whose strings contain
URL's?
(or would this involve reg ex which I've got a total mental block against?
:)


You can, however consider the following. What if, these "spammers"
turn off javascript? Your javascript would not work in this case.

Solution: Do the check on both the client side AND server side.

Jan 19 '06 #2
You can, however consider the following. What if, these "spammers"
turn off javascript? Your javascript would not work in this case.

Solution: Do the check on both the client side AND server side.


thanks web.dev ...

have done a lot of google searching on this subject --> did find out that
it's called "comment spam", ie, related to spamming user input forms, but
all of what's on the net seems to relate to "comment spamming" in Blog
software (WordPress, Moveable Type, especially). And of course, spam robots
harvesting email addresses. there's actually very few solutions offered for
people that insert hyperlinks into web-forms.

Claude
Jan 20 '06 #3
Claude wrote:
You can, however consider the following. What if, these "spammers"
turn off javascript? Your javascript would not work in this case.

Solution: Do the check on both the client side AND server side.

thanks web.dev ...

have done a lot of google searching on this subject --> did find out that
it's called "comment spam", ie, related to spamming user input forms, but
all of what's on the net seems to relate to "comment spamming" in Blog
software (WordPress, Moveable Type, especially). And of course, spam robots
harvesting email addresses. there's actually very few solutions offered for
people that insert hyperlinks into web-forms.


The bottom line is that such spammers nearly always use automated
processes to send the spam, they don't sit there and fill-in the form.

So deal with it at the server - identify likely spam and either
quarantine it for review or just ditch it. Client-side script can't do
much to help you. If links are the only problem, then search for
URI-like strings in text fields, e.g. "http://".

Blog software has built-in comment spam tools, if you are just using a
form, then you should implement something similar, e.g. introduce a
'confirm' page, require all comments to be reviewed before they are
posted, etc.
--
Rob
Jan 20 '06 #4
On 2006-01-19, Claude <am***@amour.com> wrote:
Hi,

I've designed my own form checking code for name, address, email, comment
box etc.
What my client keeps getting in his consumer feedback forms is "spam" from
companies who
repeatedly insert their hyperlinks in all fields, of course along with their
"hype"...

Is is possible with Javascript to refuse form contents whose strings contain
URL's?


not on the client side, is the server using javascript?
--

Bye.
Jasen
Jan 20 '06 #5
>> Is is possible with Javascript to refuse form contents whose strings
contain
URL's?


not on the client side, is the server using javascript?


Hi Jasen,

isn't JS a client-side scripting only (ie interpreter built into browser)?
Are you thinking of Java?

I'm new at JS, and most of the JS I utilize has been sewn together,
modified, and customized out of snippets I find on the 'net. From what I
know, it seems that JS should be able to parse the string contents of a text
input box/area for both "www" and "http", and if found, return an alert box
that arrests execution until a "clean" string is submitted. (actually it
would be better if it booted the 'bot' right off the site!)

this seems like kind of a no-brainer. It's just that I cringe at reg/ex and
there's no way I can embrace learning it at this point. if anyone here
wants to earn a few bucks thru paypal by designing a JS snippet that will
parse input strings in a form validation function as above, leave me your
email.

Claude
Jan 21 '06 #6

"Claude" <am***@amour.com> wrote in message
news:ZpnAf.111579$km.104252@edtnps89...
Is is possible with Javascript to refuse form contents whose strings
contain
URL's?


not on the client side, is the server using javascript?


Hi Jasen,

isn't JS a client-side scripting only (ie interpreter built into browser)?
Are you thinking of Java?


No, Javascript is a full blown citicen of the serverside, together with
VbScript, PHP, Perl, Et.c...

Under windows, you can also use it as a shell scripting language,
using CScript.exe

<snipped/>

--
Dag.
Jan 21 '06 #7
"Claude" <am***@amour.com> writes:
I'm new at JS, and most of the JS I utilize has been sewn together,
modified, and customized out of snippets I find on the 'net. From what I
know, it seems that JS should be able to parse the string contents of a text
input box/area for both "www" and "http", and if found, return an alert box
that arrests execution until a "clean" string is submitted. (actually it
would be better if it booted the 'bot' right off the site!)
While it is possible to make a script to test for the presence of links
in the text, it is not sufficient to prevent links from being submitted.
Merely disabling javascript would bypass the test. He could also create
his own HTTP request and send data directly to the server bypassing
your entire page.

If it is important to your server not to accept certain inputs, you
should always test that on the server. It's the only way to be sure.

You can then also test on the client, but that is only to save the
user a roundtrip to the server, when you know his input will be
rejected anyway. Client side input checking is not a security measure,
it is pure user help. It will not stop a malicious user with any
degree of technical competence.
this seems like kind of a no-brainer. It's just that I cringe at reg/ex and
there's no way I can embrace learning it at this point.


If you want to find any instance of "www" or "http" (both words that
could crop up in normal conversation, e.g. "I love the www! But I
really don't know what 'http' stands for. Anyone know?"), then the
regexp:
/\bwww\b|\bhttp\b/i
should do.

You might want to look for "www.something.something" or "http://"
or "https://" instead:
/\bwww\.([-\w]+\.)+\w{2,}\b|https?:\/\//i

But remember, test on the server for security, on the client for
usability.

Good luck.
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jan 21 '06 #8
On 2006-01-21, Claude <am***@amour.com> wrote:
Is is possible with Javascript to refuse form contents whose strings
contain
URL's?
not on the client side, is the server using javascript?

isn't JS a client-side scripting only (ie interpreter built into browser)?
Are you thinking of Java?
Microsoft have invented a way for javascript (actually J-Script(tm)) to be
used server side.
I'm new at JS, and most of the JS I utilize has been sewn together,
modified, and customized out of snippets I find on the 'net. From what I
know, it seems that JS should be able to parse the string contents of a text
input box/area for both "www" and "http", and if found, return an alert box
that arrests execution until a "clean" string is submitted. (actually it
would be better if it booted the 'bot' right off the site!)

this seems like kind of a no-brainer. It's just that I cringe at reg/ex and
there's no way I can embrace learning it at this point. if anyone here
wants to earn a few bucks thru paypal by designing a JS snippet that will
parse input strings in a form validation function as above, leave me your
email.


Most likely the application being used to spam the forms isn't running
javascript.

Javascript (client side) isn't suited to security, only to interfacce
enhancements.

Bye.
Jasen
Jan 21 '06 #9
Jasen Betts <ja***@free.net.nz> writes:
Microsoft have invented a way for javascript (actually J-Script(tm)) to be
used server side.


Them too. Netscape had it in their web server almost from the beginning
of JavaScript's history.
Javascript dialects are now used in many places, both client, server and
stand-alone (e.g., in pdf-files).

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jan 21 '06 #10
> Microsoft have invented a way for javascript (actually J-Script(tm)) to be
used server side.

Most likely the application being used to spam the forms isn't running
javascript.

Javascript (client side) isn't suited to security, only to interfacce
enhancements.

Bye.
Jasen


Hi Jasen,

I'm aware that J-script is different than Javascript; the former requiring
server-side execution. What I don't understand from reading the last few
posts is the concept of Javascript being a server-side app. When I debug or
"prove" my JS functions, I can do it on my local machine, no web server
req'd. But when I'm debugging PHP, I have to upload it to my web server
because that's where the PHP "interpreter" resides. Whereas the JS
"interpreter" is totally client-side. Therefore,my understanding is that
the interpretation and execution of JS is totally client-side.

Please correct me if I'm wrong.

What I assumed about JS "parsing" out and rejecting user input that
contained "www" or "http" is that the form could not be "submitted" without
invoking the "onsubmit" function which would perform this action of
filtering. The target email address that the form is POSTed to is not
visible on my form - it's a coded variable that fetches a "real" email
address from the CGI script, which is not readable by visitors or spam-bots.

Admittedly, my knowledge of serverside protocol is very rudimentary, but I'm
hoping some of you can "enlighten" me thus-wise!

claude
Jan 22 '06 #11
"Claude" <am***@amour.com> writes:
I'm aware that J-script is different than Javascript; the former requiring
server-side execution.
That is incorrect.
JScript is a language developed by Microsoft. It implements the
ECMAScript standard and is mostly compatible with Netscape Corp.'s
JavaScript language.
JScript is the language used to execute web-page scripts in IE with
types both text/javascript and text/jscript.
It is also available as one of the languages one can write ASP pages
in (although the newest versions of ASP uses JScript.net)

Obviosuly, the environment will be different whether the JScript
script is being run as part of a web page in a browser, as part
of an ASP page on the server or as a stand-alone script using
the windows scripting host.

Microsoft has an overview of the versions of JScript:
<URL:http://msdn2.microsoft.com/2z6exc9e.aspx>
It shows which versions comes with which other product, be it
a browser, a web server, or an operating system.
What I don't understand from reading the last few posts is the
concept of Javascript being a server-side app. When I debug or
"prove" my JS functions, I can do it on my local machine, no web
server req'd. But when I'm debugging PHP, I have to upload it to my
web server because that's where the PHP "interpreter" resides.
Whereas the JS "interpreter" is totally client-side. Therefore,my
understanding is that the interpretation and execution of JS is
totally client-side.
It can be server-side if you want it (and have IIS available).
However, the script you write for the server-side environment should
not be the same as you write for a web-client.

What I assumed about JS "parsing" out and rejecting user input that
contained "www" or "http" is that the form could not be "submitted" without
invoking the "onsubmit" function which would perform this action of
filtering.


Normally, no, but it takes nothing fancier than having Javascript
turned off in the browser to bypass the onsubmit function.

Client-side scripting cannot be used to ensure security, since the
client controls the script. A malicious client can omit or modify
the script in any way it wants to.
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jan 22 '06 #12
> Hi Jasen,

I'm aware that J-script is different than Javascript; the former requiring
server-side execution. What I don't understand from reading the last few
posts is the concept of Javascript being a server-side app. When I debug or
"prove" my JS functions, I can do it on my local machine, no web server
req'd. But when I'm debugging PHP, I have to upload it to my web server
because that's where the PHP "interpreter" resides. Whereas the JS
"interpreter" is totally client-side. Therefore,my understanding is that
the interpretation and execution of JS is totally client-side.

Please correct me if I'm wrong.
those locations are only the locations of the interpreters that you are
using.

it's possible to download a PHP executable and run it from the command-line
(I suppose that's stand-alone not client side)

similarly some web servers support javascript (etc) for generating
pages.
What I assumed about JS "parsing" out and rejecting user input that
contained "www" or "http" is that the form could not be "submitted" without
invoking the "onsubmit" function which would perform this action of
filtering.
but it can, either by editing the form, disabling scripting, or by using a
different application (eg wget or curl) to do the submissions.
The target email address that the form is POSTed to is not
visible on my form - it's a coded variable that fetches a "real" email
address from the CGI script, which is not readable by visitors or spam-bots.
Where can I see this form?

Does this address vary or it it always the same.. is there any sort of
encryption of obfuscation of the address...

when submitting form content by email mozilla gives me the option of editing
the content after the submit action but before it is sent.
Admittedly, my knowledge of serverside protocol is very rudimentary, but I'm
hoping some of you can "enlighten" me thus-wise!


Bye.
Jasen
Jan 22 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Robin Cull | last post by:
Imagine I have a dict looking something like this: myDict = {"key 1": , "key 2": , "key 3": , "key 4": } That is, a set of keys which have a variable length list of associated values after...
1
by: Robert Neville | last post by:
I would like to add filter functionality to my database whether through the Main form or the subform. This question may be rudimentary, yet I have not less experience with filtering data outside...
0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
3
by: Richard | last post by:
Hi, I have a form based on a table. When I filter the form I want to run a report based on the same table with the same filter as the form. No problem until I want to filter a combo box where...
8
by: dick | last post by:
I am just trying to print/report the results of a "filter by selection" which is done by right-clicking a form, filling in values, and "applying the filter." I have searched the newsgroups, and...
2
by: Salad | last post by:
I have a log file with a list of records. The log file can be unfiltered or filtered. I have a command button to call a data entry form from the log. At first I was only going to present the...
2
by: Mike Sweetman | last post by:
I have a form Form1 which when the Advanced Filter/Sort is used creates a form(maybe) with a title 'Form1Filter1 : Filter'. When I apply the filter to Form1 it is applied, but the value of...
4
by: Nhmiller | last post by:
This is directly from Access' Help: "About designing a query When you open a query in Design view, or open a form, report, or datasheet and show the Advanced Filter/Sort window (Advanced...
2
by: cefrancke | last post by:
I have a form (no underlying record set) that has two separate sub-forms on it. Each sub-form has data from two different tables. Above each sub-form there is one unbound combo box with a SQL...
3
by: Vern | last post by:
The following code retrieves data into a dataset, and then creates a dataview with a filter. This dataview is then attached to a combobox. When the effective date changes, I would like to see the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.