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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:43:20+00:00 2026-06-10T00:43:20+00:00

To add one feature to over 100 .htm files (to display a eu cookie

  • 0

To add one feature to over 100 .htm files (to display a eu cookie law popup) could this proposed system work:

htaccess:
redirect all incoming .htm requests to cookie.php

inside cookie.php:

$_SERVER['REQUEST_URI']
perform document search to get element in head, function{
    include cookie display files
}
document search for element in footer, function{
    Add <a href="#">Cookie Policy</a>
}
Send data to client browser

I have some things I am uncertain of.

  • would each URL not read: example.com/cookie.php
  • I am unsure how to actually spit data out using request_uri

Is this possible?

  • 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-10T00:43:21+00:00Added an answer on June 10, 2026 at 12:43 am

    It sounds like you’re lumbered with a static website that lacks any hooks into a dynamic environment.

    My approach here would be to do a global find-and-replace to insert a single hook into each file, such that you can do whatever you want to any file via that central hook.

    I’d try to insert this into the pages’ main content area. Granted this assumes each page has a similar structure – if not, you’ll need different find-and-replace operations to insert the hook into different types of page. Let’s assume each page had a main content area, a div with ID main.

    In your text editor you’d do a REGEX replace along the lines of:

    /id=('|")main\1[^>]*>/, '$0<?php include_once "hook.php"; ?>'
    

    I’m assuming a couple of things about your text editor’s REGEX implementation there, but essentially I’m inserting the PHP hook directly after the div‘s opening tag.

    Then, in hook.php, you can do what you want. So output cookie information, or whatever.

    An easier approach would be to harness any common JS hook that each page shares. So if every page loaded common.js or whatever, you could do a similar thing as described as above – only the content would be DOM-scripted into the page rather than into the source code, which is less ideal if the content is SEO sensitive.

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

Sidebar

Related Questions

If I clone a repo and subsequently add one of the downloaded files to
I have a list like this Dim emailList as new List(Of String) emailList.Add(one@domain.com) emailList.Add(two@domain.com)
I'm writing an LCD controller, and one feature I want to add is the
I am trying to add one UIView with a transition style zoom animation like
I have to add one month to todays date and have to get date
I'm trying to add one to a number inside a p element with jQuery,
how to get all anchor tag of page and add one class to mailto
I have 3 images that I want to add one after other on a
For an assignment, I need to add one objects linked list to the back
i have an xml file sitemap.xml as shown below ..i need to add one

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.