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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:52:16+00:00 2026-05-14T15:52:16+00:00

Alright so im done doing pages with frames, and know i splitted up my

  • 0

Alright so im done doing pages with frames, and know i splitted up my design to top.php and bottom.php. In top.php it’s linking to style.css and ajax_framework.js and such.. Now this works great until i tried to include top.php & bottom.php in videos/index.php (another dirr), i did like this:

include "../top.php";
<-- and the originally index.php -->
include "../bottom.php";

Now when i enter the site, it wont load style.css, probably because it thinks that style.css needs to be in videos/ directory, same goes with ajax_framework.js that are both files are on the parent ../ directory.

Now what do i do? Some method or technique to solve this in a good way? So i dont have to copy style.css and ajax_framework.js into every directory i have, because then later if i want to change something i would need to change in all directories, which would be my last thing i want to do.. hope you got some nice techniques thank you

  • 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-14T15:52:16+00:00Added an answer on May 14, 2026 at 3:52 pm

    You have at least three options:

    1. Make all your resources URL absolute URL. For instance, change <script type="test/javascript" src="scripts/foo.js"> to <script type="text/javascript" src="/scripts/foo.js">. If you can do it, it’s by far the less intrusive solution.

    2. Set a BASEDIR constant before you include top.php and make every resource path relative to it:

      // in your file that includes top.php
      <?php define('BASEDIR', '..'); ?>
      // in top.php
      <?php if(!defined('BASEDIR')) define('BASEDIR', '.'); ?>
      <link rel="stylesheet" type="text/css" href="<?php echo BASEDIR; ?>/style.css"/>
      
    3. Add a <base> HTML tag in your <head> (this one sucks, don’t do it):

      <base href="/foo"></base>
      <!-- now all srcs, hrefs and whatnot are relative to /foo -->
      

      Its sucks because even anchors will be relative to it. So if you have a link like <a href="#foo"> on the page qaz.php, with the <base href="/bar">, the link will point to /bar#foo instead of qaz.php#foo.

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

Sidebar

Related Questions

Alright, I know it can be done like so... $Array1 = array(Hello, , foo,
Alright so I have no idea how to even begin doing this But basically
Alright, here's a quick explanation of what I am doing: I have a website
Alright, so I'm running into an issue with my code. What I have done
Alright, i had this homework recently (don't worry, i've already done it, but in
Alright, I have done some research and found out that a good normalized articles
Alright, so I've done some searching around Stack and cannot find the answer to
Alright, been at C++ for about 2 days now. Just done javascript before... I'm
Alright, I have been doing the following (variable names have been changed): FileInputStream fis
Alright, I know there's a simple way to do this, but it's been years

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.