
computersmarts
Deleted
Jul 25, 2000, 7:42 AM
Post #2 of 3
(159 views)
|
I don't know how your database is set up but this is some code that I whipped up real quick. I hope it helps a little, but it will need some customization. If this does help a little and you want me to continue the code toward your database email me in more detail about your database and I wil lsee what I can do .... I hope this gives you a start.. ################################ @pairs = split(/&/, $ENV{'QUERY_STRING'}); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $QUERY{$name} = $value; } #################################### # parrse query $search = $QUERY{'search'}; $page = $QUERY{'page'}; #################################### # assigning variables if ($page eq "") { $page = "1"; } #################################### #if page is blank it will display page 1 as default $start_at = (10 * $page); #################################### # This will give you the number # to start at while pulling results # from your database, you can change the variable # to show more results per page. #################################### # put our database code here mixing in # the $start_at variable with your code # I don't know how your database is set up # so I can't help you here. #################################### # Below is what your next and previous # linking text should look like # you subtract a page for previous # results and add a page for next results # of cource you will have to do an if/else # statement to make sure there is a next and previous # page to go to. Again I don't know # the style of your database so I can't customize this help # previous = <a href="THISSCRIPT.CGI?search=$search&page=$page-1~; } # next = <a href="THISSCRIPT.CGI?search=$search&page=$page+1~; } ------------------ ========================= Matthew Miller ComputerSmarts.net "Linking the Smartest People on the Internet."
|