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 6800265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:56:54+00:00 2026-05-26T18:56:54+00:00

I want to link to a page selected randomly from all the html files

  • 0

I want to link to a page selected randomly from all the html files in a directory.

I have tried http://www.url.com/directory/?random but only get a 404 error.

Are there permissions that I need to change? What is the simplest way of doing this?

  • 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-05-26T18:56:55+00:00Added an answer on May 26, 2026 at 6:56 pm

    There is no magic in programming.

    http://www.example.com/directory/?random
    

    Won’t give you magically a random page in that directory.

    You need to write a script to do that. Example random.php.

    So you would do something like:

    http://www.example.com/directory/random.php
    

    In that random.php script, you need to write code for:

    1. List all the pages in that directory
    2. Generate a random number (1 <= n <= number_of_pages_in_directory)
    3. Take the page corresponding to that number
    4. Redirecting the browser to that page

    Code for random.php should be relatively simple.

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

Sidebar

Related Questions

I want to have java script clicking a link on the page..I found something
I have some textboxes on a page and I want to click a link
I have some link elements which are dynamically added and hidden from the page.
I have problem to pass value via url parameter to other page. I want
I want to link to a page which contains multiple support topics. When the
I want to link to bookmark on a page (mysite.com/mypage.htm#bookmark) AND visually highlight the
I want to link to a section of a page using a bookmark site.com/Page.htm#Bookmark)
I want to do something like this: page A has a link to page
The following code will generate a link to the page I want to get
I want to embed a link to a controller action in my page so

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.