this code search all data not from current pagination page

<div id="content">
.current {
padding: 2px 5px 2px 5px;
margin: 2px;
border: 1px solid #000099;
font-weight: bold;
background-color: #000099;
color: #FFF;
li {

$query=mysql_query("select * from users where FirstName like '%$_REQUEST[fullname]%'");}
$query=mysql_query("select * from users LIMIT $start, $limit");}
echo "<table border='1'>
<tr class='tableheader'>
<th>First Name</th>
<th>Last name</th>
<th>User Id</th>
<th>User Name</th>
<th>Created Date</th>
echo "<tr class='tablerow'>";
echo "<td>" . $row['FirstName']      ."</td>";
echo "<td>" . $row['LastName']       ."</td>";
echo "<td>" . $row['UserID']     ."</td>";
echo "<td>" . $row['UserName']       ."</td>";
echo "<td>" . $row['Password']       ."</td>";
echo "<td>" . $row['Email']          ."</td>";
echo "<td>" . $row['CreatedDate']    ."</td>";
echo "<td>" . $row['Gender'] . "</td>";
echo "</tr>";    
echo "</table></div>";
$rows=mysql_num_rows(mysql_query("select * from users"));
echo "<ul class='page'>";
if($i==$id) {
echo "<li class='current'>".$i."</li>"; }
else {
echo "<li><a href='?id=".$i."'>".$i."</a></li>"; }
echo "</ul>";

  <form method="post" id="frm" name="frm" action="testa.php">
    <table width="500" border="0">
        <td>Search here:</td>
        <td><input type="text"  name="fullname" id="fullname"/></td>
        <td><input type="submit" name="Submit" value="Search" /></td>

  <form style="width:50%"  method="post" id="123" name="1234" >
        <td>Go To Page:</td>
    <td><input type="text" value=""  name="pagination" class=""/></td>
    <td><input name="insert" type="submit" class="button" value="go" /></td>
$Number     =$_POST['pagination'];
header ("Location:http://localhost:1234/city/testa.php?id=$Number"); 
if ($Number >= $i){
header ("Location:http://localhost:1234/city/testa.php?id=1"); 


Recommended Answers

All 2 Replies

Member Avatar for diafol

I suggest using the url querystring key of 'page' instead of 'id'. The use of 'id' is confusing.

If your url is something like this...

Then your code need only use the $_GET['page'] variable - if it's valid. Otherwise your 'page' value should be set to '1' (default value) or if the $_GET['page'] is an integer but greater than the max number of pages, set to the 'last page' (number of pages). This value could be stored as $page. Example:

<form action="search.php?page=<?php echo $page;?>" method="get">
    <label for="searchbox">Search:</label>
    <input name="search" id="searchbox" />
    <input type="submit" value="search" id="searchbutton" />

There are a number of ways of doing this.

please send the all code from this i am getting noting

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.