get value of input element with "id" or "name"
Following are my guidelines:
1) Whenever we post a form, only name
will be considered for getting posted value. e.g.
<input type="text" name="fname" id="first_name"/>
Here we get $_POST['fname']
Not $_POST['first_name']
;
2) Id and classes are there for CSS/JS purposes. Thus if you add whatever class/id attributes to the element,
Only name
gets posted.
3) In the array $_POST
, name
is the key
and value
in it is a value.