![]() |
| Resources - HTML Client Results Page |
| Here is the HTML you need to paste into the Results page that you specified in step two. It comprises of 2 sections, the first part should be pasted in to the <HEAD> section of your page and the second part should be pasted in to the <BODY> section. You don't need to change anything for it to work but feel free to change any of the formatting if you wish. |
| The results will look like this on your site: Found 142 sites for 'bears' , Displaying results 1 to 10. 1. All you can bear (100%) Friendly site selling collectors bears. Steiff, Deans, vintage... 2. Debi's Bear Paws (100%) Specializing in Boyds Bears, Boyds Dolls and Cottage Collectib... 3. Hummelbären (100%) Lovable mohair Teddy Bears, each one of a kind, designed and h... |
| Copy and paste the following Javascript into the <HEAD> of your page: |
|
<!-- This part should be in the <HEAD> section-->
<script language=javascript> function retVal(sName) { /* get last loc. of ? right: find first loc. of sName +2 retrieve value before next & */ var sURL = new String(window.location); var iQMark= sURL.lastIndexOf('?'); var iLensName=sName.length; //retrieve loc. of sName var iStart = sURL.indexOf('?' + sName +'=') //limitation 1 if (iStart==-1) { //not found at start iStart = sURL.indexOf('&' + sName +'=')//limitation 1 if (iStart==-1) { //not found at end return 0; //not found } } iStart = iStart + iLensName + 2; var iTemp= sURL.indexOf('&',iStart); //next pair start if (iTemp ==-1) { //EOF iTemp=sURL.length; } return unescape(sURL.slice(iStart,iTemp )) ; } function displaySearchResults() { // Constant variables var remoteSearchPage="http://www.collectiblestop25.com/cgi-bin/ranker/publicsearch.cgi"; // Find out how many sites were returned, how many sites to display per page and where the display should start // These posted values need to be converted to integer types because posted data is always a string var pageStart=parseInt(retVal('pS')); var resultsPerPage=parseInt(retVal('rPP')); var resultsReturned=parseInt(retVal('nOS')); var pageFinish=0; // Calculate the last site to display on this page if (pageStart+(resultsPerPage-1)<resultsReturned) { pageFinish=pageStart+(resultsPerPage-1); } else { pageFinish=resultsReturned; } // Display how many sites were found using which text and the results which are being displayed document.write("Found " + resultsReturned + " sites for '" + retVal('searchText') + "'"); // If there were sites found show which sites are being displayed if (resultsReturned>0) { document.write(", Displaying results " + pageStart + " to " + pageFinish + ".<br><br>"); } // Display the sites which were found for(searchResult=pageStart;searchResult<=pageFinish;searchResult++) { document.write("<b>" + searchResult + ".</b> <a href='" + retVal('lT' + searchResult) + "'>" + retVal('sN' + searchResult) +"</a> <font size=1>(" + retVal('mP' + searchResult) + "%)</font><br>"); document.write("<font size=2>" + retVal('sD' + searchResult) + "</font><br><br>"); } // Create the form to be used to fetch the previous results if we are not at the start if (pageStart>1) { var startOfPreviousPage=(pageStart)-resultsPerPage; document.write("<form name='showPrevious' method='post' action='" + remoteSearchPage + "'>"); document.write("<input type='hidden' name='clientResultsPage' value='" + retVal('clientResultsPage') + "'/>"); document.write("<input type='hidden' name='searchtext' value='" + retVal('searchText') + "'/>"); document.write("<input type='hidden' name='resultsPerPage' value='" + resultsPerPage + "'/>"); document.write("<input type='hidden' name='pageStart' value='" + startOfPreviousPage + "'/>"); document.write("</form>"); } // Create the form to be used to fetch the next results if we are not at the end if (pageFinish<resultsReturned) { var startOfNextPage=(pageStart)+resultsPerPage; document.write("<form name='showNext' method='post' action='" + remoteSearchPage + "'>"); document.write("<input type='hidden' name='clientResultsPage' value='" + retVal('clientResultsPage') + "'/>"); document.write("<input type='hidden' name='searchtext' value='" + retVal('searchText') + "'/>"); document.write("<input type='hidden' name='resultsPerPage' value='" + resultsPerPage + "'/>"); document.write("<input type='hidden' name='pageStart' value='" + startOfNextPage + "'/>"); document.write("</form>"); } // Display the appropriate previous and next buttons if (pageStart>1) {document.write("<a href='javascript:document.showPrevious.submit();'><< previous</a> ");} if (pageFinish<resultsReturned) {document.write("<a href='javascript:document.showNext.submit();'>next >></a>");} } </script> <!-- End of <HEAD> section --> |
| Copy and paste the following Javascript into the <BODY> of your page: |
|
<!-- This part should be in the <BODY> section -->
<script language=javascript> displaySearchResults(); </script> <!-- End of <BODY> section --> |