Solved

Dynamic Pages & Dynamic Links

Posted on 2006-10-27
8
167 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
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…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

914 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

13 Experts available now in Live!

Get 1:1 Help Now