PhP form submitted after javascript check

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rasmus

    #1

    PhP form submitted after javascript check

    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?
  • Janwillem Borleffs

    #2
    Re: PhP form submitted after javascript check


    "Rasmus" <manu.delattre@ wanadoo.fr> wrote in message
    news:9f7da317.0 312020601.22257 68b@posting.goo gle.com...[color=blue]
    >
    > 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?[/color]

    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



    Comment

    • kaeli

      #3
      Re: PhP form submitted after javascript check

      In article <9f7da317.03120 20601.2225768b@ posting.google. com>,
      manu.delattre@w anadoo.fr enlightened us with...[color=blue]
      >
      > 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?
      >[/color]

      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.

      --
      --
      ~kaeli~
      In democracy your vote counts. In feudalism your count votes.



      Comment

      Working...