使用HTML变量进行PHP分页

I have been going through pagination tutorials for past 1 week. I have an html page wherein user enter values into the textfields and click submit button. The page then redirects to a php page which displays corresponding output from the sql database. The database makes use of variables which were received by the php script from the HTML page. I am trying to paginate the final table displayed on the php page but have been unable to do so. Relevant Code for the same is: Search.html
ClOrdID
Symbol

**index.php**
 <?php $clordid = $_POST['clordid'];?>
   <?php $orderid = $_POST['orderid'];?>  
//connected to database using mysqli
 $result = mysqli_query($con,"SELECT * FROM abc where clordid like '$clordid' and      orderid like '$orderid'
  while ($row = $result->fetch_array(MYSQLI_BOTH)) {
  echo "<tr>";
  for($k=0;$k<150;$k++){
  echo "<td>" .$row[$k]. "</td>";}

This code works fine. When I run this query again to calculate total number of rows and also total number of page links to be displayed in pagination, that works as well. However, whenever I click next page using pagination, the code forgets the value of variables imported earlier from html page. I tried to pass it using the url but has been unsuccessful. I believe somehow the values from html page must be retained by the program at all times to make query execute successfully at all times. Can anyone provide me some basic example (or a url) that could help me understand the process? Thanks

You can assign the variable to the session like so:

session_start();
if ($_GET['page_number'] == 1){
    $_SESSION['clordid'] = $_POST['clordid'];
}