Taking Sides

taking-sidesEveryone at some point needs to take sides.  In this case, I am referring to server-side and user-side.  Your web site lives on a server owned by your host and is served to visitors.  The user’s browser receives the information, interprets it, and displays it for the user.  There are languages that work server-side such as PHP and languages that function on the user-side such as JavaScript.  Since PHP is occurring on the server, these activities are virtually invisible to the user unless you want them to be.  This makes PHP very appropriate for things like validation of user input data.  Why not use PHP for everything?  Since PHP occurs on the server, user information usually needs to be sent via a page refresh which is relatively slow.  AJAX can allow you to send data to the server without a page refresh but more on that later.  JavaScript is running on the user’s machine so it runs quickly but is not secure.  It can certainly be used to help users try to enter their data correctly but should not relied upon for validation.

Speaking of validation, all user submitted data should be considered suspect.  Whether inadvertently or intentionally, users can enter some malicious code as part of their responses.  It is important to validate all incoming data and sanitize all outgoing data to maintain adequate security of your site and its databases, if you have them.  The server-side is the right side for these activities.

About Robert

Robert is a novice web site developer. A lack of professional training has not prevented him from creating some very nice websites for small businesses who would otherwise have gone without a web presence.

Subscribe

Subscribe to our e-mail newsletter to receive updates.

No comments yet.

Leave a Reply