It doesn't matter if they are the same or not, but you normally need them both. The name attribute identifies the input for the form processing script, which the id associates the input with an accompanying <label> element, which has a "for=" attribute.
<label <font color='"#FF8C00"'>for="blah"</font>>Blah</label>
<input name="blah" <font color='"#FF8C00"'>id="blah"</font>>
The for="blah" / id="blah" associates the label with the input. That's handy for people using a screen reader (who can't "see" the relationships) and also means you can click on the Label to activate the input.
Of course, the id on the input can also be used as a hook for JS and CSS.