Clarification on .html.php file names

I was going through the tutorials and noticed Kevin has some files named .html.php (example: error.html.php). I may have missed where he mentioned it, but I was curious as to why. Why not name it just error.php?

Thank you

I believe that html is included in the name as a note so you know the the file content is html, as opposed to php scripting.
Which tutorial specifically are you referring to? I suspect it is one on SP by @kevinyank

Thanks for the quick reply. Yes, PHP and MySQL for beginners.
He has it in Lesson 6, Step 6: Handling SELECT Result Sets.
Just a bit odd as won’t the file names give you a good enough indication of what the file will be doing? Very nit picky on my part, but was just very curious.

Thanks again

If the filemane ended with .html then it would not be parsed as php. So it needs the .php extension on the end to work.

Oh, right. I was thinking error.php, instead of error.html.php. Understood that it needs the php on the end.

Yes, the .php is to make it parse as php and the .html is just for the coder’s benefit, so you know that it’s an html template file as opposed to a php script, it’s not actually required, but can be helpful.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.