Solved

Dynamic Pages & Dynamic Links

Posted on 2006-10-27
8
170 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…

839 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