Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8220155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:25:34+00:00 2026-06-07T13:25:34+00:00

Hi I have 2000 html files in one folder and their names follow upon

  • 0

Hi I have 2000 html files in one folder and their names follow upon each other like this:

01_001.html
01_002.html
01_003.html
01_004.html
02_001.html
02_002.html
02_003.html
…………..
33_001.html
33_002.html
33_003.html
…………..
33_123.html

I would like to add add a link/script to all 2000 HTML files that will dynamically go to the next/previous HTML page in the same folder

I know how to add this in PERL, but what should that kind of link/script look like in JavaScript/jQuery

I have tried this script:

<a href="#" onClick="movePrv();">Previous</a> end <a href="#" onClick="moveNext();">Next</a>

But it does not work. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T13:25:35+00:00Added an answer on June 7, 2026 at 1:25 pm

    A solution in PHP might look like this:

    <?php
    $file = basename(__FILE__);
    $chap = substr($file, 0, 2);
    $cat = substr($file, 3, 3);
    $prevFile = sprintf("%1$02d_%2$03d.php", $chap, ($cat-1));
    $nextFile = sprintf("%1$02d_%2$03d.php", $chap, ($cat+1));
    echo($prevFile);
    echo($nextFile);
    
    $isFirst = ($cat == "000");
    $isLast = !file_exists($nextFile);
    ?>
    

    Use the variables $nextFile and $prevFile to create Links. You might also want to check whether the current file is the first or last in a chapter and then not to show a previous or next link.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple HTML page with svg like this: <div id=plan> <svg xmlns=http://www.w3.org/2000/svg version=1.1>
I'm using jQuery version 1.7.1 from Google CDN and have the following code: $(menuInstance).delay(2000).removeClass('loading').html(ul);
I was recently asked this question in an interview. Lets suppose I have 2000
I have an SQL Server 2000 db, and I would like to retrieve summary
This is a part of my HTML I have embedded the SVG element. <div>
I have a document like this: <?xml-stylesheet type=text/css href=http://ltw1001.web.cs.unibo.it/svg.css encoding=UTF-8?> <!DOCTYPE html PUBLIC -//W3C//DTD
I have a bunch of html files in a site that were created in
I have a site with 2000 pages and I want to iterate through each
I have local HTML files that I'm displaying with a UIWebView. Everything is displaying
I have code like this: $(document).ready(function() { $(div #covert, div #coverb).height($(window).height() / 2 +

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.