Jump to content

Recommended Posts

I was not sure where to post this. Anyway, I'm undergoing some revision for my Summer exams and have a few issues. What I'm looking for is 3 situations:

 

1) Where would you use only client side programming and why?

2) Where would you use only server side programming and why?

3) Where would you use both and why?

 

any ideas guys?

Link to comment
https://forums.phpfreaks.com/topic/49858-clientserver-sscripting/
Share on other sites

1. brochure (static) type site - it doesn't matter if people see the source code...it doesn't have anything "valuable" in it

2. dynamic/secure sites - server side scripts don't allow you to see the source of the actual code...only the output, plus server side is a lot more flexible

3. a simple site with a few dynamic elements. like an informational site with a news section. - All of their main sections stay the same but the client just wants to change one page.

 

 

is this what you were looking for?

Thanks for the reply mate. So if I want 'static' pages - stuff that never changes, this should be done on client side scripting.. but downside, client side scripting is browser dependant and source code insecure?

 

and for point 2, im still a bit confused. A situation where server side scripting is used, but not client side scripting. Possibly something like a web forum or something? made in only PHP?

let me see if I can iron this out...

 

if you view source on an html page you will see <html><body> and so on...

 

in a server side script the ACTUAL code would be say

include "header.php";

and header.php would be <html><body> and so on... SO when someone views a source of a php page they see <html><body> and so on... and NOT include "header.php";

 

hope that makes sense.

I'm answering this strictly in terms of web development.

 

1) Where would you use only client side programming and why?

Instances where you want to improve the client interface, such as DHTML or AJAX programming.  The simple example is a form submission; normally the entire form needs to be submitted to the server, processed, and then the server will either accept or reject the form based on it's validity.  Using a client-side scripting language you can validate the form before it's ever sent, thus telling the user to fix errors before they ever reach the server.

 

2) Where would you use only server side programming and why?

Instances where you have to have tight control over the data.  Continuing the form example from above, while you can use a client-side language to validate the form before it's been submitted, you can not rely on that as your only form validation.  You still need to validate the form on the server in case the client has Javascript disabled.

 

3) Where would you use both and why?

Instances where you want your web page to become a web application, i.e. highly interactive and stream lined in terms of usability.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.