0
file extensions
why are some.html, .php, .asp, etc.? when does a web page become a .php instead of an .html? is .php best used when gathering data interactively from the user(s)? (also, trying to get another badge.)
1 Odpowiedź
+ 2
If you put php code in a HTML file, it won't interpret it correctly and probably just spit out text. You can think of the file extension as telling the executing platform how to read the contents. Making a file .php will allow php commands to be interpreted as such.
php is run server side and can be used in a user-responsive way. You can produce html dynamically based on any criteria, you have the power of a programming language at your disposal. Being compiled server side hides the code from the user and can be more secure than plain js