i have two page one is search.php and other is detail.php
in search.php

 <div class="search-field ">
      <form class="d-flex align-items-center h-100" name="search" action="manage_visitor.php" method="post" >
        <div class="input-group" style="background-color: #f2edf3;">
          <input type="text" class="form-control bg-transparent border-0"name="searchdata" id="searchdata" placeholder="Search by names &amp; mobile no"   >
        </div>

Detail.php i get the value of there pagination code like

echo '<li class="'.$active.'" ><a class="page-link" href="manage_visitor.php?page1='.$i.'&searchname='.$_POST['searchdata'].'">'.$i.'</a></li>';

$searchstring= isset($_GET['searchname'] )?$_GET['searchname']:"";

for the first click the url look like

http://localhost/company/manage_visitor.php?page1=2&searchname=bilal

but after 2nd time click

http://localhost/company/manage_visitor.php?page1=2&searchname=

now is there way to store the value of searchname=bilal or set the value of search.php text field searchname value from detail.php

I think your mistake is mixed use of variable names "searchdata" and "searchname"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.