PhP form submitted after javascript check

R

Rasmus

Hi everybody,
I made an enrolment form using PhP on the server side and Javascript
on the client side to check the form validity.
When the server gets the form parameters (method POST), it builds a
string with all the data and sends an email containing the string to
the Webmaster who handles enrolments.
Everything seems to work fine on IE 5.5 and higher, Netscape 4.0 and
higher, but time to time the Webmaster receives empty emails (should
not happen since the javascript does not submit empty form).

A spy on the server showed me that the following explorers have sent
empty emails:
Googlebot/2.1 engine
Mozilla/4.0 (compatible; MSIE 4.0; Windows 95)
Mozilla/4.77 [en] (X11; U; Linux 2.2.19 i686)

Anyone has an idea of what's going on?
 
J

Janwillem Borleffs

Rasmus said:
A spy on the server showed me that the following explorers have sent
empty emails:
Googlebot/2.1 engine
Mozilla/4.0 (compatible; MSIE 4.0; Windows 95)
Mozilla/4.77 [en] (X11; U; Linux 2.2.19 i686)

Anyone has an idea of what's going on?

Any browser or bot which doesn't parse the JS code, will be able to do this.

Client-side JS validation should always be followed by server-side
validation.


JW
 
K

kaeli

A spy on the server showed me that the following explorers have sent
empty emails:
Googlebot/2.1 engine
Mozilla/4.0 (compatible; MSIE 4.0; Windows 95)
Mozilla/4.77 [en] (X11; U; Linux 2.2.19 i686)

Anyone has an idea of what's going on?

The user may not have an email client or the mail client had an error
(if using mailto). The user may not have script enabled or installed.
The client browser may have had an error with the script.

This is why server-side checking and mailing should always be used (in
addition to js validation if client-side checking is also desired). You
also quite possibly haven't received mail from people who otherwise
would have liked to mail you because they don't have a default client
(if you use mailto).

If you have the server do the mail, you should still validate on the
server as well as the client because of js errors or users who don't
have js enabled or installed.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top