I've writen this code to remove elements from the URL string but I'm finding that I have to press the delete button twice for it to be recorded. Is there any way the code can be eddited to remove this problem?

PHP Code:
<form name="delrowx" method="post" action="?lastname=<?php echo "$lastname";  
              
          
$boxes=$_REQUEST['deleterowMe'];
                  
$nou=0;                   //worktype list
                  
$nov=0;            
                  while(
$nou<($wrktpeno)){
                  if(!
in_array("$nou",$boxes)){
                  echo 
"&worktype[$nov]=$wrktpe[$nou]";
                  
$nov++;}
                  
$nou++;
                  }
                  
$noy=0;  
                  
$noz=0;                             //tretype list
                  
while($noy<($rows_in_tables)){                  
                  if(!
in_array("$noy",$boxes)){
                  echo 
"&items[$noz]=$Items_array[$noy]";
                  
$noz++;}
                  
$noy++;
                  }
              
              
              
?>">
HTML Code:
-- this line is in a loop showing a different $number for each item in the URL string. --
<input type="checkbox" name="deleterowMe[<?php echo "$number"; ?>]" value="<?php echo $number; ?>" />

<input type="submit" name="Deluse" value="Del" />

</form>
Thanks!