0

Why do we have to put php code inside the html file while we want it to be executed at the server?

10th Jun 2019, 2:47 PM
sourabh Jhamnani
sourabh Jhamnani - avatar
3 Antworten
+ 3
PHP is a server-side language which was processed with an engine resides in web server, as opposed to HTML that natively run in client browser. This combination allows you to hide actual implementation and persist user session without sacrificing security by exposing internal working to public user. Clear as mud? 😉
10th Jun 2019, 3:12 PM
Zephyr Koo
Zephyr Koo - avatar
+ 2
sourabh Jhamnani Basically the flow is like following:- 🔽 Client's browser make a HTTP request 🔽 PHP server attempt to serve the request by matching with specific resource which usaully is a combination of HTML and PHP 🔽 Process PHP algorithm and replace with HTML whenever applicable 🔽 Return processed file in HTML to client's browser *simplified for brevity
10th Jun 2019, 3:37 PM
Zephyr Koo
Zephyr Koo - avatar
0
So,the php script we write inside the html file resides in the server and the client browser requests to run the script using hyperlink??
10th Jun 2019, 3:24 PM
sourabh Jhamnani
sourabh Jhamnani - avatar