客户端与服务器端基础

客户端与服务器端基础

问题描述:

在过去的6个月里,我一直试图围绕Web开发,理解客户端编程和服务器端编程之间的差异。目前我只知道客户端处于中等水平(javascript / jQuery) )但我也有兴趣学习PHP和MySQl进行服务器端编程。

For the last 6 months I have been trying to wrap my head around Web development and understanding the diferences beetween client-side programming and server side programming.For the moment I only know the client side at an medium level(javascript/jQuery) but I am also interested in learning PHP and MySQl for server-side programming.

客户端编程和服务器端编程有什么不同?

What are the diferences of client side programming and server side programming?

我何时使用客户端以及何时使用服务器端?

When do I use client side and when do I use server side?

那些Web开发人员需要知道两者都有效在写网站?

Those a web developer need to know both to be effective in writing website?

客户端编程包括任何编码或计算或效果或动画或网站执行的任何类型的互动用户通过浏览器。但服务器端编程只执行服务器中的所有任务。所以用户没有意识到这一点。

Client side programming includes any coding or computation or effects or annimation or any sort of interaction your website performs with the user via browser. But server side programming is that which performs all the task in the server only. So the user is unaware of that.

例如,PHP用于服务器端编程。您使用HTML设计一个网站并在其中使用JavaScript来从用户那里获取一些输入并进行修改。更具体地说,如果您创建了一个博客网站,并且您想指定该用户最多可以发布5000个字符。然后,您使用JavaScript进行一些客户端编程,以计算字符数和任何过滤或任何内容。但是,您需要将这些帖子发送到服务器。然后,服务器执行一些服务器端任务,可以使用PHP来清理SQL注入的输入并将其保存到数据库中。

For example, PHP is used for server side programming. You design a website with HTML and use JavaScript in it to take some input from user and modify it in anyway. To be more specific, if you created a blog website and you want to specify that the user can post a max of 5000 characters. Then you do some client side programming with JavaScript to count the number of characters and any filtering or anything. But then you need to send those posts to the server. The server then performs some server side task, may be with PHP, to sanitize the input for SQL Injection and saves it into a database.

用户只会知道浏览器中发生了什么,但不知道服务器中发生了什么。这些是后台任务。

User will only know what happened in the browser but not what happened in the server. Those are background tasks.