Client side vs. Server side JavaScript

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

    Client side vs. Server side JavaScript

    Hello,

    I am starting a new website, and I would like to decide ahead of time
    what functions (in JavaScript) I will need to write on the server side
    and which ones on the client side. I believe that some validations are
    important on the client side, and I am thinking of writing some php
    validations for the server side. What types of functions are usually
    written on the server side?
    What types are usually written on the client side?

    I am making my pages in php.

    1. In this site users will be able to log in.
    2. I will have a register page.
    3. My accounts page.
    4. And a page that they can post listings in.
    5. An admin page that will keep track of billing accounts.

    I hope this gives some good explanation. If not let me know, and I can
    describe more.
    Thank you for your help!
    byuedwin

  • Ant

    #2
    Re: Client side vs. Server side JavaScript

    "byuedwin" <byuedwin@gmail .com> wrote in message
    news:1107910279 .327537.313260@ f14g2000cwb.goo glegroups.com.. .[color=blue]
    > Hello,
    >
    > I am starting a new website, and I would like to decide ahead of time
    > what functions (in JavaScript) I will need to write on the server side
    > and which ones on the client side. I believe that some validations are
    > important on the client side, and I am thinking of writing some php
    > validations for the server side. What types of functions are usually
    > written on the server side?
    > What types are usually written on the client side?
    >
    > I am making my pages in php.
    >
    > 1. In this site users will be able to log in.
    > 2. I will have a register page.
    > 3. My accounts page.
    > 4. And a page that they can post listings in.
    > 5. An admin page that will keep track of billing accounts.
    >[/color]

    Validation of data the user enters in registration forms etc should be
    checked client side as they can then correct those mistakes straight away
    rather than sending off the incorrect info and then being asked to make the
    changes. It's quicker that way.


    Comment

    • Matthew Lock

      #3
      Re: Client side vs. Server side JavaScript

      > Validation of data the user enters in registration forms etc should
      be[color=blue]
      > checked client side as they can then correct those mistakes straight[/color]
      away[color=blue]
      > rather than sending off the incorrect info and then being asked to[/color]
      make the[color=blue]
      > changes. It's quicker that way.[/color]

      No! You should check on the server side as a naughty user can disable
      Javascript and just submit whatever they want to your server program,
      causing all manner of security risks.

      Comment

      • Matthew Lock

        #4
        Re: Client side vs. Server side JavaScript

        > What types are usually written on the client side?

        The only validation that belongs on the client side is validation that
        you could live with the user bypassing, by disabling javascript.
        [color=blue]
        > 1. In this site users will be able to log in.
        > 2. I will have a register page.
        > 3. My accounts page.
        > 4. And a page that they can post listings in.
        > 5. An admin page that will keep track of billing accounts.[/color]

        None of these are candidates for client side validation. They should
        all be done on the server side. (Especially the billing one!)

        Comment

        • David Dorward

          #5
          Re: Client side vs. Server side JavaScript

          Matthew Lock wrote:
          [color=blue][color=green]
          >> Validation of data the user enters in registration forms etc should[/color]
          > be[color=green]
          >> checked client side as they can then correct those mistakes straight[/color]
          > away[color=green]
          >> rather than sending off the incorrect info and then being asked to[/color]
          > make the[color=green]
          >> changes. It's quicker that way.[/color][/color]
          [color=blue]
          > No![/color]

          Yes!
          [color=blue]
          > You should check on the server side[/color]

          You should do that to, and you should make it a priotity, but it can be
          useful to users to have a second (earlier) check on the client side.

          --
          David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
          Home is where the ~/.bashrc is

          Comment

          Working...