1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

What is the difference between client side and server side validation?

Discussion in 'PHP' started by muzam, Jul 3, 2012.

  1. #1
    What is the difference between client side validation and server side validation and what is more secure and why? Please explain in brief if you can.
    muzam, Jul 3, 2012 IP
  2. kajol

    kajol Active Member

    Likes Received:
    Best Answers:
    Trophy Points:
    Client side validation will be written using client side scripts like JavaScript or VB Script. Whereas the server side validation will be written using your server side programming language such as PHP, JSP, PERL or anything you are using. Always go with Server side validation, it will be very helpfull, if your client side script has any error or the script is disabled in client's browser.
    kajol, Jul 4, 2012 IP
  3. eritrea1

    eritrea1 Active Member

    Likes Received:
    Best Answers:
    Trophy Points:
    When you submit your e-mail thorough a web form, let say:

    If you use client-side validation (Javascript) - the browser (Firefox, IE, Chrome...) will validate the e-mail without having to send it to the server.
    Which means, no Internet connection needed, it's fast since you don't have to wait for the page to be refreshed to see the validiation..

    With Server side validation, everything is the opposite. I would say client side validation is safer.

    But, if someone has disabled javascript in their browser then that would mean, their web browser is unable to validiate the form so i guess like the above person indicated.. server side validation would be safer, because they can not turn off server validation in their browser.
    eritrea1, Jul 4, 2012 IP