Friday, November 22, 2019

Server-Side Scripting in PHP

Server-Side Scripting in PHP Server-side scripting as it relates to web pages usually refers to PHP code that is executed on the web server before the data is passed to the users browser. In the case of PHP, all PHP code is executed server-side and no PHP code ever reaches the user. After the PHP code is executed, the information it outputs is embedded in the HTML, which is sent to the viewers web browser. One way to see this in action is to open one of your PHP pages in a web browser and then choose the View Source option. You see the HTML, but no PHP code. The result of the PHP code is there because it is embedded in the HTML on the server before the web page is delivered to the browser. Example PHP Code and Result While the server-side PHP file may contain all the code above, the source code and your browser only display the following information: My cat Spot and my dog Clif like to play together. Server-Side Scripting vs. Client-Side Scripting PHP isnt the only code that involves server-side scripting, and server-side scripting isnt limited to websites. Other server-side programming languages are Python, Ruby, C#, C, and Java. There are many instances of server-side scripting, which provides a customized experience for users. In comparison, client-side scripting operates with embedded scripts- JavaScript is the most familiar- that are sent from the web server to a users computer. All the client-side script processing takes place in a web browser on the end users computer. Some users disable client-side scripting due to security concerns.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.