Trying to access rowid of phpgrid in another page but not getting it in PHP

    I want to retrieve rowid of a phpgrid on the page the same i included it using SESSION e.g
    
         $id=$_SESSION['id'];
    
            However when it use var_dump($id); I get respond String(8) without the actual value. 
           Below 
            is my code.
      



 1. lasttest.php
    
        <?php
         require_once('../phpGrid_Lite2/conf.php');       
        ?>
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
         <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
         <head>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Select Multiple Rows</title>
         <script type="text/javascript">
    
        </script>
        </head>
         <body> 
    
         <?php
    
          $dg = new C_DataGrid("SELECT * FROM uploaded", "id", "treated"); 
    
    
    
         $onSelectRow1 = <<<ONSELECTROW
          function(status, rowid)
          {
          //alert('event 1');
          console.log(rowid);
          console.log(status);
       
        /* example to redirect a new URL when select a row */
        cabinet = $('#uploaded').jqGrid('getCell',rowid,'cabinet');
        cabinet_name = $('#uploaded').jqGrid('getCell',rowid,'cabinet_name');
        //alert(rowid);
         //window.location = encodeURI("http://example.com/" + "?" + "cabinet=" +cabinet + 
         "&cabinet_name="+cabinet_name);
         }
         ONSELECTROW;
         $dg->add_event("jqGridSelectRow", $onSelectRow1);
         $dg -> display();
          ?>
          </body>
          </html>
    
    
            2. retrieverowid.php
                <?php
        require_once('checklogin.php');
        $date=@date('l jS of F Y h:i:s A');
        require_once('connect1.php');
        $do = new db;
        $do->doconnect();
        //Get Return Page
        $username=$_SESSION['username'];
        //$cate=$_SESSION['cate'];  
        $mytype = $_SESSION['mytype'];
        $Link =$_SESSION['link']; 
            $count = count($Link);
            $loggedUBranch= $_SESSION['cate'];

        $uploaddir = "uploadsbenefit/"; 



            $command = "";
            if (isset($_POST['Submit'])) {
            $myfilename = $_FILES['file']['name'];
            $FileToAddSize =$_FILES['file']['size'];
            
            $ispdf = @end(explode(".",$myfilename));
            //$file_extension = pathinfo($file_name, PATHINFO_EXTENSION);
            $ispdf = strtolower($ispdf);
            
             if($ispdf !='pdf'){
             echo "Sorry, You can only merge PDF files, press browser back button to continue";
             exit;
             }
             
             //Get original filename from the database
            $id = $_SESSION['id'];
            var_dump($id);
            
            $Orig = $do->gett("select * from uploaded where id ='$id'");
            $OriginalFileNameOnServer = "uploadsbenefit/".$Orig['file_name'];
?>
</table></td>
                <td valign="top" width="73%"bgcolor="#FFFFFF">
                
                                <div align="center"><span id=""></span>
                                  
                                        <div id = 'retrievetable' class="style17" >
                                                <?php include 'lasttest2.php'?>
                                            
                                  </div>

                                    <table style="width: 700px; height: 14px;" align="center" width="706">
                                        <tbody>
                                        <tr>
                                        <td>
                                        <div id = "myresult" align="left">
                                        </div>
                                        <div>
                            
                                        </div>
                                        
                                        
                                        <div class="uploader">          
            
                                                <form id ="actionform" method="post" action="" enctype="multipart/form-data">
                                                <p> <input name="file" id="file[]" type="file" /></p>  
                                                <p>Allowed Files: .pdf </p>
                                                 <input type="submit" name="Submit" value="Merge Files" />
                                                 <input type="button" name="Delete" id = "deletebtn" value="Delete Selected" />
                                                </form>
                                                                            
                                         </div>`enter code here`

I want a sitiuation whereby when I click on the Merge files Button i should be able to retrieve the clicked rowid using Sesssion which i will thereafter use it to select the actual selected row from the database. I have tried several options but it is not working for me. anytime i try using var_dump($id) i get string(8) without the actual rowid number.

Thank you in advance