Solved

Dynamic Pages & Dynamic Links

Posted on 2006-10-27
8
171 Views
Last Modified: 2011-10-03
Hi All

I'm looking for a routine that will create dynamic pages & dynamic links at the bottom of a page. Say I had a have a database with One-hundred links in it I would like it to print 10 links on 10 pages just like most search engines do. I'm looking to do this without the use of any modules.
0
Comment
Question by:blnukem
  • 4
  • 2
  • 2
8 Comments
 
LVL 4

Expert Comment

by:vi_srikanth
ID: 17824595
Suppposing if u r using mysql, a query like the following would give the results in tens:

$query="SELECT * FROM mytable LIMIT $from_counter, 10";

You can pass the value of $from_counter through GET/POST method.
0
 

Author Comment

by:blnukem
ID: 17825103
vi_srikanth

I'm not runing mysql just a plain and simple text data base.
0
 
LVL 4

Expert Comment

by:vi_srikanth
ID: 17825122
Ok... You said supposing there are 100 links in ur text database, it should be shown as 10 pages with 10 links in each page. How do u want the result? Do u want them in 10 different text files? or Do u want them in a web page in which one page will be shown after other?... Basically if u explain what u r trying to do, it will be helpful.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:blnukem
ID: 17825297
10 seprate pages with 10 links on a page just like google, msn or ee return.
0
 
LVL 16

Accepted Solution

by:
manav_mathur earned 500 total points
ID: 17828405
Assuming that you have a webpage setup which has page numbers a s links, and on clicking one of those links, calls this script with 'pagenumber' as the parameter containing the pagenumber,

my $pagenum = param('pagenumber') ;
local @ARGV=('/path/to/databasefile') ;
my @entries = <> ;
print @entries[(10*$pagenum-1)..(10*$pagenum+9)] ;
0
 

Author Comment

by:blnukem
ID: 17830440
manav_mathur

Code works great for producing the page content but I also need it to produce
page numbers "LINKS + 10" at the bottom of the page to click through thouse links
should contain the $pagenum Value that will show page content 1=10 11-20 21-30 Ect...
0
 
LVL 16

Expert Comment

by:manav_mathur
ID: 17830488
you can hardcode them into the HTML.
Link for "page 1" should set pagenumber=0 and call this script.
Link for "page 2" should set pagenumber=1 and call this script.
...
...
0
 

Author Comment

by:blnukem
ID: 17830544
OK Thank You!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question