Hi Peoples
i have a search page with a form field "subject" on my results page i have a paging routine . the first page lists its 10 records no trouble but when i click the "next" link i get a error telling me "subject is not defined in form"
How can i overcome this please.
I will post the page down to the end of the paging routine coz its not very long anyway.
[HTML]<cfquery name="searchResults" datasource="#dsn#">
SELECT threadID, posttype, topic, topicID, postdate, username, threads.catID, posttext, categories.catID, category
FROM threads INNER JOIN categories
ON threads.catID=categories.catID
WHERE topic LIKE '#form.subject# %' OR topic LIKE '% #form.subject#' OR topic LIKE '% #form.subject# %' OR topic LIKE '#form.subject#'
OR username LIKE '#form.subject#'
OR posttext LIKE '#form.subject# %' OR posttext LIKE '% #form.subject#' OR posttext LIKE '% #form.subject# %' OR posttext LIKE '#form.subject#'
</cfquery>
<!---Set the number of entries (records) per page--->
<cfset perPage = 10>
<!--- Set the parameter "url.start" default to 1--->
<cfparam name="url.start" default="1">
<cfif not isNumeric(url.start) or url.start lt 1 or url.start gt searchresults.recordCount or round(url.start)
neq url.start>
<cfset url.start = 1>
</cfif>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<link href="CSStyle/forum.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="Layer2" style="position:absolute; left:0; top:0; width:30px; height:23px; z-index:6">
<cfinclude template="header.cfm">
</div>
<div id="Layer3" style="position:absolute; left:75px; top:190; width:850; height:83px; z-index:7">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<cfoutput>
<tr>
<td colspan="2"><span class="standard33">Your search for</span> <span class="standardred">'#form.subject#'</span> <span class="standard33">returned </span><span class="standardred">'#searchResults.RecordCount#'</span> <span class="standard33">results.</span></td>
<!---DISPLAY PAGE NAVIGATION BUTTONS---><!---DISPLAY PAGE NAVIGATION BUTTONS--->
<cfoutput>
<tr class="standard">
<td colspan="3" align="right">
<cfif url.start gt 1>
<cfset link = cgi.script_name & "?start=" & (url.start - perpage) & "&subject=" & "#subject#">
<span class="small11-33"><a href="#link#"><< Previous</a></span>
<img src="siteImages/navSeperator.gif" width="5" height="5">
</cfif>
<cfif (url.start + perpage - 1) lt searchresults.recordCount>
<cfset link = cgi.script_name & "?start=" & (url.start + perpage) & "&subject=" & "#subject#">
<span class="small11-33"><a href="#link#">Next >> </a></span>
</cfif>
</td>
</tr>
</cfoutput>
<!---END DISPLAY PAGE NAVIGATION BUTTONS--->[/HTML]
Cheers and thanks in advance
Grabit