473,943 Members | 34,226 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

15 results per page.

tom
Hi all,

I'm having a bit of trouble getting my site to output a certain number of
results per page. Any help on this would be greatly appriciated. Without
this function my code outputs all results on one page and for some queries
there are hundreds of results that take a long time to uotput and wastes a
lot of bandwidth.
Heres a quick rundown on the structure of my site:-

index.html
|
\_/
search1.asp (uses Request.Form to get item, subCat, colour and price from
index.html
| search1.asp opens data.xml and results.xml and passes
the above parameters)
|
\_/
results1.xsl (this file transforms the data.xml)
|
\_/
next1.asp (uses Request.QuerySt ring to get item, subCat, colour, price
and startPos when 'next'
| is clicked)
\_/
results11.xsl (when you click 'next' on this page the parameters are passed
back to next1.asp and so on)
My code is working to some extent as it does show the first 15 results when
you click 'search' on the home page but I get an error when I click next on
that page. see for yourself www.madtim67.com When you do click 'next' the
parameters are being passed if you look in the address bar but for some
reason next1.asp doesn't seem to work correct.
search1.asp
++++++++

<%@ Language="VBScr ipt" %>

<%

dim objDom, fileExists, objFieldValue, objPI

cr1 = Request.Form("i temQuery")
cr2 = Request.Form("S ubCat")
cr3 = Request.Form("c olourQuery")
cr4 = Request.Form("p riceQuery")

set xmlDocument = CreateObject("M SXML2.FreeThrea dedDOMDocument" )
xmlDocument.asy nc="false"
xmlDocument.loa d(Server.MapPat h("db\data.xml" ))

set xslDocument = CreateObject("M SXML2.FreeThrea dedDOMDocument" )
xslDocument.asy nc="false"
xslDocument.loa d(Server.MapPat h("results1.xsl "))

Set XSLTemplate = Server.CreateOb ject("MSXML2.XS LTemplate")
Set XSLTemplate.sty lesheet = xslDocument
Set proc = XSLTemplate.cre ateProcessor()

proc.input = xmlDocument

proc.addParamet er "item1", cr1
proc.addParamet er "subCat1", cr2
proc.addParamet er "colour1", cr3
proc.addParamet er "price1", cr4

proc.output = Response
proc.transform

%>



results1.xsl
++++++++

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:styleshe et
version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso-8859-1" />

<xsl:param name="item1" />
<xsl:param name="subCat1" />
<xsl:param name="colour1" />
<xsl:param name="price1" />
<xsl:param name="startPos" select="0" />
<xsl:param name="recordsPe rPage" select="15" />
<xsl:param name="endPos" select="$startP os + $recordsPerPage " />

<xsl:template match="/">

<html>
..
..
..(code that outputs data.xml)
..
..
<a href="javascrip t:history.go(-1)">previous</a> |
<a
href="next1.asp ?item={$item1}% subCat={$subCat 1}%colour={$col our1}%price={$p rice1}%startPos ={$endPos}">nex t</a>

</body>

</html>

</xsl:template>

</xsl:stylesheet>



next1.asp
++++++

<%@ Language="VBScr ipt" %>

<%

dim objDom, fileExists, objFieldValue, objPI

cr1 = Request.QuerySt ring("item")
cr2 = Request.QuerySt ring("subCat")
cr3 = Request.QuerySt ring("colour")
cr4 = Request.QuerySt ring("price")
cr5 = Request.QuerySt ring("startPos" )

set xmlDocument = CreateObject("M SXML2.FreeThrea dedDOMDocument" )
xmlDocument.asy nc="false"
xmlDocument.loa d(Server.MapPat h("db\data.xml" ))

set xslDocument = CreateObject("M SXML2.FreeThrea dedDOMDocument" )
xslDocument.asy nc="false"
xslDocument.loa d(Server.MapPat h("results11.xs l"))

Set XSLTemplate = Server.CreateOb ject("MSXML2.XS LTemplate")
Set XSLTemplate.sty lesheet = xslDocument
Set proc = XSLTemplate.cre ateProcessor()

proc.input = xmlDocument

proc.addParamet er "item1", cr1
proc.addParamet er "subCat1", cr2
proc.addParamet er "colour1", cr3
proc.addParamet er "price1", cr4
proc.addParamet er "startPos", cr5

proc.output = Response
proc.transform

%>



results11.xsl
++++++++

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:styleshe et
version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso-8859-1" />

<xsl:param name="item1" />
<xsl:param name="subCat1" />
<xsl:param name="colour1" />
<xsl:param name="price1" />
<xsl:param name="startPos" />
<xsl:param name="recordsPe rPage" select="15" />
<xsl:param name="endPos" select="$startP os + $recordsPerPage " />

<xsl:template match="/">

<html>
..
..
..(code that outputs data.xml)
..
..
<a href="javascrip t:history.go(-1)">previous</a> |
<a
href="next1.asp ?item={$item1}% subCat={$subCat 1}%colour={$col our1}%price={$p rice1}%startPos ={$endPos}">nex t</a>

</body>

</html>

</xsl:template>

</xsl:stylesheet>
Apr 8 '06 #1
0 1441

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2034
by: Francisco | last post by:
I have this question: I have a simple search to a db, something like: "select description from games where year = '1990'" suppose I get 300 results, I would like to display this in pages of 30 results per page, so I would use "limit 0, 30" for the first page. But this way, I don't know how many results would I have if I didn't use "limit". So how do I know if I have more than one page to display?, the only way I can thing is to do the...
4
2589
by: NotGiven | last post by:
Say you have three pages, a search page, a results/master, and a detail page. You choose parameters on your search page and submit the page. The results show in the reults/master page. You click one to go the details page. You hit the browser button to go back and it shows the results/master page but shows "Page has expired" error. How can you prevent this? How can you show the results page whether you get
0
2820
by: david liu | last post by:
access 2000 query: here's what i want to do. from an asp page, perform a search on a table in access. i have used sql code in the asp page itself, but i'd rather execute a query in access. i have success in running any query (basic SELECT, SELECT with conditions _other_ than LIKE, etc..) for some reason, when i execute the query below from the asp page, i get no results. the search.asp page just has a text box in a form that submits...
2
3546
by: CharitiesOnline | last post by:
Hello, I have set this script up to add paging to a search results page. Which on the first page works fine. I calculates how many pages there should be depending on the number of results returned from my search and how many records I have set it to display per page. All great so far, HOWEVER..... When you click the next link to see the next 10 results on the next page, it just dumps the search details and pulls up all the records in the...
3
1578
by: AbeR | last post by:
I have written a fairly simple reporting app that has been working for a few years without any issues until this past week. The application has a login page with a DSN lookup for login/password validation. A confirm login asp page does a redirect back to the login page if failed or to a menu page if passed where I pull information from the database into session variables that I pass throught the app for dynamic/individualized queries I...
5
3026
by: George | last post by:
Hi, Anyone has the background for explaining? I have made a search on my name and I have got a link to another search engine. The link's title was the search phrase for the other search engine (a wicked phrase). Some but not all of the words of that phrase exist in my website. I reported it and they removed the link but did not give explanations.
3
1758
by: Rick | last post by:
Hello, I ran Microsoft's free "Web Application Stress" tool to see how asp.net/c# performed against html. Are these results typical? Network: WAS ran on a server with a t3 Internet connection to the test server. Test Server: Windows 2000 SP 4
4
2756
by: PI | last post by:
Hi guys, I'm struggling with this much longer than I think I need to, I guess you could help me here: How do I make the results of a search display on the same page as the search, sort of beneath the 'submit' button? Thanks for helping out. Regards, Ire
7
2436
by: daveeboi | last post by:
..I have been strugling to get this part of my site working correctly even though I can't see anything wrong with my code. I am trying to search a database and display paged results. But everytime I perform a valid test expecting a few results to appear I am left with the No Matches message, so it's not a coding error as such. The code shown below is what I have for my search.php, please could someone put me out of my misery. <html>...
3
1517
by: Bigalan | last post by:
Hello, i am relatively new to PHP and i am struggling with printing multiple search results on to different pages. The code below works ok but when you click on next page button, it brings up a blank screen. I think it might have something to do with resetting the $found variable. Can you have a quick look? any suggestions would be greatly appreciated. <? if ($_GET) $vars=$_GET; else $vars=$_POST; $found = $vars;
0
9970
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11538
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9866
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8226
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6311
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4515
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.