Major Difference Between JS and PHP
|Type of Scripting language||Client side||Server side|
|Access to database||No||Yes|
|Access to file system||No||Yes|
|Programming Paradigm||Prototype based||class based|
|Can be embedded in HTML||Yes using <script> tag||Yes using <?php … ?>|
How the client-server architecture works
The network on the internet work based on the client-server architecture. Let’s see the image below to understand it clearly.
Clients and servers are connected to the internet (WWW). A server is a machine where we upload our website and it consists of websites. Any computers, laptops, or mobile devices connected to the internet is considered client, within the client, we will have a browser like a google chrome, safari, opera, etc. With the help of the browser, we request the page to the server. The request will send to the server and the server locates the page “if it is available”, the server sends the page as a response back. That page will be displayed or rendered by the browsers, we can see the page in a browser. So, the client is request to the server, and the server responds back to the request. Hope you understood, how the client-server architecture works.