Html vs. htm vs firefox doc

Hi Since you folks know everything web related…or have people who know.
Writing my tags & codes in notepad.
Should I save my web files as html or htm?
Also it is showing right now as “firefox doc”
Advice? Anyone? Please?

A quick answer to your Firefox Document. You have Firefox as your browser, so if you look at a file with html or htm extensions, you will see that the file is associated with Firefox and is labeled by Windows as a Firefox Document.

I think most folks now use the html extension, but either will work.

If you’re using Windows Notepad, I would suggest you switch to something with syntax highlighting - perhaps jEdit or [url=]PSPad - both of which are free.

or Notepad++

I always use html, I’ve never really heard of anyone nowadays using htm

Using both .htm and .html can be useful if you want to be able to apply different server side languages and hide what languages you are using.

Typically I’d use *.htm over *.html (my personal choice) but usually I’d use *.xht anyway or something else. Though like was mentioned earlier usually on a static off-line standalone document it doesn’t tend to make much different whether *.htm or *.html is used assuming the file associations are correct.

Can you elaborate on this? Your single sentence leaves me with questions.

How does using .htm and .html hide what language you are using?

Is there a reason to hide which language you are using?

I typically use .php on my sites. Should I change to something else, and if so why and how?

With Apache and .htaccess you can alter the extension and so forth. I use PHP on my online websites but may use *.xht, *.htm, *.html or something completely different like: *.zog but they are actually being parsed by the PHP-parser.

For example:

[FONT=Courier New]AddType application/x-httpd-php .html .htm

Process *.htm and *.html as PHP[/FONT]

Obviously some people may want to disguise what programming language they are using or just want constancy of extensions, or to apply specific rules on certain extensions, etc.

If I add:
AddType application/x-httpd-php .html .htm

Process *.htm and *.html as PHP

to my .htaccess I can then use .html and have the php processed?

I still do not understand why you would want to hide the language used. I can see the benefit of using .html or .htm so the visitors are not troubled by the .php, but I wonder how many even notice?

One good reason would be security. There’s no point in making it easy for potential bad guys to figure out what kind of target they’re looking at.

Second this. Most people would want to hide their programming language to prevent injection attacks.

I just did a little reading on injection attacks and realize I have a LOT to learn about setting up a database input form.

Oh yeah. It’s really turtles all the way down.

You get really excited about learning HTML. Then you think, wait, it’s not pretty, gotta learn CSS. Then you say well it’s not very interactive, then you gotta learn Javascript. Then you say, well it should be dynamic and interact with a server, and you gotta learn PHP and SQL. Then you want it to be more complicated and have to learn about database structures. Then you learn about security issues and you gotta learn about sanitizing and validation, XSS, and bots. Continue and rinse repeat ad nauseum.

I’m unsure at what point it ends, or I say “hell, this is too much for 1 person”

Perhaps because you wrote the pages as static HTML in the first place and don’t want to change their names and have to redirect hundreds or thousands of pages.

Having .htm and .html also allows you to be selective as to which of your pages include server side processing - you might have .htm as static pages and .html includes PHP or perhaps the .htm pages use some other language instead of PHP.

I use .php on my sites,as static pages .html includes PHP.

Most web browsers treat the files with html or htm extension the same. The difference lies because of server’s default filenames.If the server is configured to use “welcome.html” as the default filename, your file must be named “welcome.html” and not “welcome.htm.”