How to hide PHP script in PHP/ HTML page?

Michael

New member
I check one web page written in PHP, but when I view source it, there's no php script in the source code. It's pure HTML. I'm pretty sure there's some php script in that page since it processes a form. I wonder how to do that?
 
It does it automatically. PHP is a server-side scripting language, not a client-side markup language like HTML or client-side scripting language like Javascript. You never see PHP code because it's processed on the server before it ever gets to the browser. PHP outputs HTML... so what you're actually seeing is the output that the PHP generated on the server.

Basically, what happens is this:

1) Browser requests content for index.php

2) Server looks for index.php and runs the code in the file.

3) Server sends the result of running the code (which, usually, is a string of HTML code) to the browser.

4) Browser reads the HTML and displays the web page.
 
Back
Top