You need to start a "FOR" loop.
change
if ($a=1;$a<=5;$a++)
to
for ($a=1;$a<=5;$a++)
But ya know... that's just going to print out five text boxes, all with the name "fname". So if this is posted to a PHP script, only the value of the 5th textbox will hold true.
Perhaps you meant to try something like:
<input type=text name="fname_<?=$a?>">
That would print the value of your loop incrementor.. giving you
fname_1
fname_2
...
fname_5