![]() |
| Resources - Perl Client Results Page |
| Here is the Perl you need to paste into the Results page that you specified in step two. You shouldn'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 30. 1. All you can bear (100%) Friendly site selling collectors bears. Steiff, Deans, vintage, Merrythought and Artist bears. Free U.K. shipping. 2. Debi's Bear Paws (100%) Specializing in Boyds Bears, Boyds Dolls and Cottage Collectibles for about 30% less than retail. Free Shipping in the continental united states for orders greater than $100. 3. Hummelbären (100%) Lovable mohair Teddy Bears, each one of a kind, designed and hand made by artist Rosi Ploen (Germany) |
| Copy and paste the following Perl into the section that renders your <BODY> output: |
|
# Get the values from the posted data my $buffer = ""; read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/,$buffer); foreach $pair (@pairs) { # Put the posted data in to a hash # Constant variables that are used later in the code # Find out how many sites were returned, how many sites to display per page
and where the display should start my $resultsReturned=$input{'numberOfSites'}; # Calculate the last site to display on this page # Display how many sites were found using which text and the results which
are being displayed # If there were sites found show which sites are being displayed # Display the sites which were found # Create the form to be used to fetch the previous results if we are not at
the start # Create the form to be used to fetch the next results if we are not at the
end # Display the appropriate previous and next buttons |