Client side vs. Server side JavaScript

B

byuedwin

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
 
A

Ant

byuedwin said:
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.

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.
 
M

Matthew Lock

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.

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.
 
M

Matthew Lock

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.
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.

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

David Dorward

Matthew said:
Yes!

You should check on the server side

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.
 

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

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top