1

I want to handle data with PHP by post method and I want to know if both ways ("post" and "POST") are recommended.

Should I use method="POST" or method="post" in HTML form?

Thanks.

Community
  • 1
  • 1
eightShirt
  • 1,457
  • 2
  • 15
  • 29

2 Answers2

5

Better to stick with lowercase so you aren't tempted to type all your tags and attributes as if you're shouting at the browser. Also, you should be coding your modern HTML to the XHTML standard, not to 90s HTML.

This is the 90s way: <FORM METHOD="POST" ACTION="">

Today its advised to use lowercase for tags and attributes, although for the values of the attributes do whatever you want: <form method="post" action="">, <form method="POST" action="">

Why? Because of XHTML. For a document to be valid XHTML the spec says:

4.2. Element and attribute names must be in lower case

XHTML documents must use lower case for all HTML element and attribute names. This difference is necessary because XML is case-sensitive e.g. <li> and <LI> are different tags.

Of course for ids and names like in <input id='x' name='product_id' /> the capitalization matters as <input id='X' name='Product_Id' /> the id is different to the DOM and the name sent to the server is now different.

developerwjk
  • 8,619
  • 2
  • 17
  • 33
  • 1
    XHTML has lost its relevancy. Since HTML5 the normalized serialization is sufficient. Unless you actually utilize different XMLNSes, synthetic attribute quotes and strict casing are causeless bells and whistles. – mario May 22 '14 at 23:41
  • @mario, Until you want to parse your HTML with an XML parser to make some changes to it programmatically or extract some things. I prefer not having to go back and clean that up first. – developerwjk May 23 '14 at 18:46
  • I'd rather use a HTML parser frontend than a XML one on HTML. – mario May 23 '14 at 18:51
0

It doesnt matter, HTML isnt case sensitive though its more common to capitalize it.

meda
  • 45,103
  • 14
  • 92
  • 122