Oh, no wonder it looked weird. That's a huge echo statement you've got there, and you're trying to shovel another entire statement into the middle of it.
This gives an idea how to alter it.
<?php
function form ()
{
?>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post" enctype="multipart/form-data">
<input type="hidden" name="category" value="<?php echo $_GET['filecategory']?>">
<table border="1" cellspacing="0" cellpadding="2" bordercolor="#000000" style="border-collapse: collapse; border-style: solid; border-width: 1">
//.............
</tr>
</table>
</form>
<?php
}