CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
display Search Results..????

 



webhay
Novice

Dec 2, 2000, 7:50 AM

Post #1 of 2 (329 views)
display Search Results..???? Can't Post

I can't display Search Results Ten Recordes And Ten Recordes.I search In CSV File File

please help
With Code........

thanks

------------------
Haytham Taher


Rivotti
User

Dec 12, 2000, 10:54 AM

Post #2 of 2 (328 views)
Re: display Search Results..???? [In reply to] Can't Post

Hi webhay,

letīs see if this helps...

Use in html file Ex:

<a href="http:/blablabla/file.cgi?number=10>Next 10</a>

In the CGI file

$count = 1;
$current_view = param('number');
$next_ten = $current_view+10;

open(INFILE,"text.csv") || die;
while(<INFILE>) {
if(($count >= $current_view)&&($count < $next_ten)) {
print "$_";
}
$count++;
}
close(INFILE);

if ($current_view == 1) { $prev_ten = 1; }
else { $prev_ten = $current_view-10; }

if ($next_ten >= $count) { $next_ten = $current_view; }
else { $next_ten = $current_view+10; }

Now you can use the $next_ten and $prev_ten in the output file


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives