how to use $_POST to post a php variable
I have a php variable "echo $id". Now I want to use the $_POST method to post the variable. I just want to know how to do this for a variable because $_POST[$id] does not work? I want the $id to be posted from the form into another page.

Below is my function where the $id is in:

    function id_generator(){ 
    	      
    	      $id = ""; 
    	      $a = array( "A" , "B"); 
          
          for( $i = 0 ; $i < 3 ; $i++ ){ $r = rand( 0 , 25 );
           $id .= $a[ $r ]; 
           
       }
       
       return $id;
    }

Below is the form:


    		 <form action="QandATable.php" method="post" id="sessionForm">
    		 <p><strong>1: Your Session ID: </strong><?php echo $id; ?></p>
    </form>
     

Thanks

how to use $_POST to post a php variable
===

I have a php variable "echo $id". Now I want to use the $_POST method to post the variable. I just want to know how to do this for a variable because $_POST[$id] does not work? I want the $id to be posted from the form into another page.

Below is my function where the $id is in:

    function id_generator(){ 
    	      
    	      $id = ""; 
    	      $a = array( "A" , "B"); 
          
          for( $i = 0 ; $i < 3 ; $i++ ){ $r = rand( 0 , 25 );
           $id .= $a[ $r ]; 
           
       }
       
       return $id;
    }

Below is the form:


    		 <form action="QandATable.php" method="post" id="sessionForm">
    		 <p><strong>1: Your Session ID: </strong><?php echo $id; ?></p>
    </form>
     

Thanks
