Solved

Dynamic Pages & Dynamic Links

Posted on 2006-10-27
8
166 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
 

Author Comment

by:blnukem
ID: 17825297
10 seprate pages with 10 links on a page just like google, msn or ee return.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now