please can ay one fix this bug on urgent basis
The paging is not working after search
(it means that once we search any area then result comes is working but when we go to second page search is lost and it shows unfiltered recod)

<!-- #include file="connect.asp" -->

<link href="css/layouts.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style36 {color: #FFFFFF}
-->
</style>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="setInterval('blinkIt()',500)">

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr> 

<td width="100%" height="100%" valign="top"><table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">

<td align="left" valign="top" class="rightsideline">

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Working Area ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<table width="100%" cellpadding="0" cellspacing="0">

<tr>
<td align="left" valign="top" class="bodytext">

<table width="100%" cellpadding="2" cellspacing="0">


<tr><td colspan="2"><table width="100%" cellpadding="1" cellspacing="1">

</table>
</td>
</tr> 

<tr><td colspan="2">

<form name="form8" method="get" action="welcome.asp?jj=1" style="margin:0; word-spacing:0;">

<table width="100%" cellpadding="2" cellspacing="1">
<tr bgcolor="#D5DCEE">
<td width="36%" bgcolor="#AE0812" ><div align="center"> <font class="style7 style36">Transaction Type</font>
<select name="proptranstype" class="txt_bx" >
<option value="" selected>Select Transaction Type----------</option>
<option value="Sell" >Sell</option>
<option value="Rent" >Rent</option>

</select>
</div></td>
<td width="34%" align="right" bgcolor="#AE0812"><div align="center"> <font class="style7 style36">Select 
Product:</font>
<select name="propcat" class="txt_bx" >
<option value="" selected>Select Property Category---------</option>
<option value="Apartment" >Apartment</option>
<option value="Commercial Office" >Commercial Office</option>
<option value="Land" >Land</option>
<option value="Individual House (Villas)" >Office</option>
<option value="Retail Space" >Retail Space</option>
<option value="Warehouses" >Warehouses</option>
<option value="Industrial Estates" >Industrial Estates</option>
</select>
</div></td>
<td width="30%" bgcolor="#AE0812"><span class="style36 style30"><strong>Locality: </strong></span> <select name="locality" class="txt_bx" >
<option value="" selected>-----Select a Locality </option>
<option value="South Mumbai" >South Mumbai</option>
<option value="Western Suburbs " >Western Suburbs </option>
<option value="Central Suburbs " >Central Suburbs </option>
<option value="South West Mumbai" >South West Mumbai</option>
<option value="Navi Mumbai" >Navi Mumbai</option>
<option value="Andheri" >Andheri</option>
<option value="Jogeshwari" >Jogeshwari</option>
<option value="Goregaon" >Goregaon</option>
<option value="Malad" >Malad</option>
<option value="Kandiwali to Dahisar" >Kandiwali to Dahisar</option>
<option value="Bandra" >Bandra</option>
<option value="Khar" >Khar</option>
<option value="Powai" >Powai</option>
<option value="Vile Parle" >Vile Parle</option>
<option value="Others" >Others</option>


</select></td>
</tr>
<tr bgcolor="#D5DCEE">

<td colspan="5" align="center" bgcolor="#AE0812"><input type="submit" name="Submit3" value="Search" class="btn3"></td>
</tr>
</table>
</form> 
</td>
</tr>








<tr><td colspan="3"><table width="100%" cellpadding="2" cellspacing="1">
<tr bgcolor="#D5DCEE"> 
<td bgcolor="#AE0812"><span class="style36">
<%if request("msg")<>"" then %>
<span class="style7"><blink><strong><%=request("msg")%></strong></blink></span></span>
<span class="style36">
<%end if%>
</span></td>
</tr>
</table>
</td>
</tr>
<tr><td colspan="3"><table width="100%" cellpadding="5" cellspacing="2">



<% 
sql1="select * from prop_features where active= 'yes'"
sql2="select count(*) from prop_features where active= 'yes'" 


if request("locality") <>"" then
response.write("locality exist")
sql=sql & " and locality like '"&trim(request("locality"))&"'" 
end if 




if request("proptranstype")<>"" then

sql=sql & " and transactiontype like '"&trim(request("proptranstype"))&"'" 
end if 

if request("propcat")<>"" then
sql=sql & " and pcat like '"&trim(request("propcat"))&"'" 
end if 

sql1=sql1 & sql &" order by id desc" 
sql2=sql2 & sql 


sp=8
set rs=conn.execute(sql2)
count=rs(0)

p=int((count+(sp-1))/sp)


pp=request("pg")
if pp=0 or pp="" then
pp=1
end if


se= pp*sp

%>
<!-- ~~~~~~~~~~~~~~~~~~ Paging Row ~~~~~~~~~~~~~~~~ -->
<tr>

<td height="25" colspan="3" class="style7">Pages: 
<%
if pp=1 then%>
<b>1 </b> 
<%else%>

<a class="maroonlink" href="welcome.asp?locality=<%request("locality")%> &jj=<%=request("jj")%>&ty=<%=request("ty")%>&typ=< %=request("typ")%>&display=<%=sp%>&q=<%=sql%>&pg=< %=1%>">1</a> 
<%end if 

if pp<=500 then
sh1=2
sh2=11
else%>
.... 
<%
if pp+5>p then
sh1=p-9
sh2=p
else
sh1=pp-5 
sh2=pp+5
end if
end if

if sh2>p then
sh2=p
end if

for i= sh1 to sh2 %>
<%if int(pp)=i then%>
<b><%=i%></b> 
<%else%>
<a class="maroonlink" href="welcome.asp?locality=<%request("locality")%> &jj=<%=request("jj")%>&ty=<%=request("ty")%>&typ=< %=request("typ")%>&display=<%=sp%>&q=<%=sql%>&pg=< %=i%>"><%=i%></a> 
<%end if%>
<%next%>
<%if sh2<p then%>
.... 
<%if pp=p then%>
<b><%=p%></b> 
<%else%>
<a class="maroonlink" href="welcome.asp?locality=<%request("locality")%> &jj=<%=request("jj")%>&ty=<%=request("ty")%>&typ=< %=request("typ")%>&display=<%=sp%>&q=<%=sql%>&pg=< %=p%>"><%=p%></a> 
<%end if%>
<% end if%>
| 
<%if pp-1>0 then%>
<a class="maroonlink" href="welcome.asp?locality=<%request("locality")%> &jj=<%=request("jj")%>&ty=<%=request("ty")%>&typ=< %=request("typ")%>&display=<%=sp%>&q=<%=sql%>&pg=< %=pp-1%>&p=<%=p%>">&laquo;Previous</a> 
<%end if%>
&nbsp;&nbsp;&nbsp; 
<%if pp+1=<p then%>
<a class="maroonlink" href="welcome.asp?locality=<%request("locality")%> &jj=<%=request("jj")%>&ty=<%=request("ty")%>&typ=< %=request("typ")%>&display=<%=sp%>&q=<%=sql%>&pg=< %=pp+1%>&p=<%=p%>">next 
&raquo;</a> 
<%end if%> </td>
</tr>
<!-- ~~~~~~~~~~~~ Paging row ~~~~~~~~~~~~ -->


<tr><td colspan="3">




<form name="form1" method="post" action="welcome.asp">



<table border="0" width="100%" align="left" cellpadding="0" cellspacing="0">
<tr class="bodytext">
<!-- border talble color -->
<td bgcolor="#000000"> 

<table width="100%" border="0" cellspacing="1" cellpadding="6">
<tr bgcolor="#DDDD99" class="content" > 
<td colspan="11" bgcolor="#AE0812"><span class="style7 style36">Total No. of units 
- <%=count%></span></td>
</tr>

<tr bgcolor="#DDDD99" class="content"> 

<td width="13%" bgcolor="#AE0812" class="style7"><div align="center"><span class="style36">Prop Id</span></div></td>

<td width="25%" bgcolor="#AE0812" class="style7"><div align="center" class="style36">Title</div></td>
<td width="16%" bgcolor="#AE0812" class="style7"><div align="center" class="style36">Transaction Type</div></td> 
<td width="16%" bgcolor="#AE0812" class="style7"><div align="center" class="style36">Property Category</div></td> 

<td width="13%" bgcolor="#AE0812" class="style7"><div align="center" class="style36">Locality</div></td>
<td width="17%" bgcolor="#AE0812" class="style7"><div align="center" class="style36">City</div></td> 
</tr>
<%
set rs=conn.execute(sql1)%>
<%ppp=(pp-1)*sp
if not rs.eof then
rs.move(ppp)
end if

'if not rs.eof then
spp=sp-1
k=0
j=1
while not (rs.eof or k>spp) 
k=k+1



%>
<tr bgcolor="#FFFFFF" class="style10"> 

<td width="13%" bgcolor="#FFFFFF" class="style12"><div align="center"><strong><a href="propdetails.asp?id=<%=rs("id")%>" target="_blank"><%=rs("propid")%></a></strong></div></td>

<td width="25%" bgcolor="#FFFFFF" class="style12"><div align="center"><%=rs("title")%></div></td>
<td width="16%" bgcolor="#FFFFFF" class="style12"><div align="center"><%=rs("transactiontype")%></div></td>
<td width="16%" bgcolor="#FFFFFF" class="style12"><div align="center"><%=rs("pcat")%></div></td>

<td width="13%" bgcolor="#FFFFFF" class="style12"><div align="center"><%=rs("locality")%></div></td> 
<td width="17%" bgcolor="#FFFFFF" class="style12"><div align="center"><%=rs("city")%></div></td> 
</tr> 
<%
rs.movenext
j=j+1
wend

'else
%>

<%
'end if%>
</table> </td>
</tr> 
</table>
</form>





</td></tr>


<!-- ~~~~~~~~~~~~~~~~~~ Paging Row ~~~~~~~~~~~~~~~~ -->
<tr>

<td height="25" colspan="3" class="style7">Pages: 
<%
if pp=1 then%>
<b>1 </b> 
<%else%>
<a class="maroonlink" href="welcome.asp?jj=<%=request("jj")%>&locality=< %request("locality")%>&ty=<%=request("ty")%>&typ=< %=request("typ")%>&display=<%=sp%>&q=<%=sql%>&pg=< %=1%>">1</a> 
<%end if 

if pp<=500 then
sh1=2
sh2=11
else%>
.... 
<%
if pp+5>p then
sh1=p-9
sh2=p
else
sh1=pp-5 
sh2=pp+5
end if
end if

if sh2>p then
sh2=p
end if

for i= sh1 to sh2 %>
<%if int(pp)=i then%>
<b><%=i%></b> 
<%else%>
<a class="maroonlink" href="welcome.asp?jj=<%=request("jj")%>&locality=< %request("locality")%>&ty=<%=request("ty")%>&typ=< %=request("typ")%>&display=<%=sp%>&q=<%=sql%>&pg=< %=i%>"><%=i%></a> 
<%end if%>
<%next%>
<%if sh2<p then%>
.... 
<%if pp=p then%>
<b><%=p%></b> 
<%else%>
<a class="maroonlink" href="welcome.asp?jj=<%=request("jj")%>&locality=< %request("locality")%>&ty=<%=request("ty")%>&typ=< %=request("typ")%>&display=<%=sp%>&q=<%=sql%>&pg=< %=p%>"><%=p%></a> 
<%end if%>
<% end if%>
| 
<%if pp-1>0 then%>
<a class="maroonlink" href="welcome.asp?jj=<%=request("jj")%>&ty=<%=requ est("ty")%>&locality=<%request("locality")%>&typ=< %=request("typ")%>&display=<%=sp%>&q=<%=sql%>&pg=< %=pp-1%>&p=<%=p%>">&laquo;Previous</a> 
<%end if%>
&nbsp;&nbsp;&nbsp; 
<%if pp+1=<p then%>
<a class="maroonlink" href="welcome.asp?jj=<%=request("jj")%>&ty=<%=requ est("ty")%>&locality=<%request("locality")%>&typ=< %=request("typ")%>&display=<%=sp%>&q=<%=sql%>&pg=< %=pp+1%>&p=<%=p%>">next 
&raquo;</a> 
<%end if%> </td> 
</tr>
<%'end if%>
<!-- ~~~~~~~~~~~~ Paging row ~~~~~~~~~~~~ -->
</table>





</td>
</tr>
</table>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Working Area Ends~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->



</td>
</tr>
</table></td>

</tr>

</table>
</td></tr></table>

A simple request - Please show only the relevant portion of the code. No one has the time or patience to go through 5 pages of ur code containing style definitions and table layout. Please remember, everyone helping you is doing it for FREE. Don't burden their time or patience

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.