title: Passing php variable from one form to another page with hidden value
body: <p>After passing a php variable(Tno) from one page to another page using button with hidden value,  with that variable(Tno) tried to retrieve the data from the database, but I am not able to retrieve with that variable i.e. Tno. I had attached form1.php and retrieve.php. </p>
  
  <p><strong>form1.php</strong></p>
  
  <pre><code>   &lt;?php
     session_start();
     ?&gt;
  
     &lt;?php
     if( isset ($_SESSION["Email"])) {
     $con=mysql_connect("localhost","admin","password");
     // Check connection
     if (!$con)
     {
     //echo "i am not ale to connect.&lt;br&gt;";
     die('Could not connect: ' . mysql_error());
     }
     else{
     //echo " i am able to connect.&lt;br&gt;";
     }
  
      mysql_select_db("maintable", $con);
  
      $Email = mysql_real_escape_string($_SESSION['Email']);
  
  
     $sql1="select * from customer where Email=('$Email')";
     $result1=mysql_query($sql1);
     while($row = mysql_fetch_array($result1)){
     $var1 = $row['Identity'];
      }
     //echo" Email of the customer = $Email.&lt;br&gt;";
     //echo "identity of the customer = $var1.&lt;br&gt;";
  
    $sql2= "SELECT * FROM  `suptest` WHERE Tno LIKE '$var1%'";
    $result2=mysql_query($sql2); ?&gt;
    &lt;table border=0 width=50%&gt;
    &lt;tr&gt; 
    &lt;th&gt;Ticket Ref. No.&lt;/th&gt; &lt;th&gt;Subject&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;/tr&gt;
    &lt;?php
    while($row = mysql_fetch_array($result2)){ 
    $ticketno= $row['Tno'];
     ?&gt;
    &lt;form  action="retrieve.php" method="post"&gt;
  
    &lt;tr&gt;&lt;td&gt;&lt;?php echo $row['Tno']; ?&gt;&lt;input type="text" value="&lt;?php echo $row['Tno']; ?  &gt;" name="Tno" /&gt;&lt;/td&gt;
   &lt;td&gt;&lt;?php echo $row['sub']; ?&gt;&lt;/td&gt;
   &lt;td&gt;&lt;?php echo $row['status']; ?&gt;&lt;/td&gt;
   &lt;td&gt;&lt;input type="Submit" value="Update" /&gt;&lt;/td&gt;&lt;/tr&gt;
   &lt;/form&gt;
   &lt;?php
   } ?&gt;
   &lt;/table&gt;
   &lt;?php
   mysql_close($con);
    }
    ?&gt;
  
      &lt;?php
      session_start();
      ?&gt;
      &lt;html&gt;&lt;head&gt;&lt;/head&gt;
      &lt;body&gt;
      &lt;?php
      $con=mysql_connect("localhost","admin","password");
      //echo "Check connection";
      if (!$con)
      {
      //echo "I am not ale to connect.&lt;br&gt;";
      die('Could not connect: ' . mysql_error());
      }
      else{
      //echo "I am able to connect.&lt;br&gt;";
      }
      mysql_select_db("maintable", $con);
     $Tno = mysql_real_escape_string($_POST['Tno']);
  
     //echo "my tno is $Tno.&lt;br&gt;";
     $Email = mysql_real_escape_string($_SESSION['Email']);
     echo $Email;
     $sql = "select * from `active1active1` where Tno = ('$Tno')";
     if (!mysql_query($sql,$con))
     {
     die('Error: ' . mysql_error());
     }
     $result=mysql_query($sql);
     echo $result;
     echo mysql_num_rows($result);
     echo "entering while loop";
     while($row=mysql_fetch_array($result))
     { 
      echo "entered while loop";
      echo $row['Tno'] . "&lt;br /&gt;";
      echo $row['Email'] . "&lt;br /&gt;";
      echo $row['pdesc'] . "&lt;br /&gt;";
      echo $row['Activity'] . "&lt;br /&gt;";
       }
       ?&gt;
  
       &lt;/body&gt;&lt;/html&gt;
  </code></pre>