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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:08:45+00:00 2026-06-17T08:08:45+00:00

I don’t see the error.. I have an index file under the web root.

  • 0

I don’t see the error..

I have an index file under the web root. Index file sets an array with basic paths, like so:

$medium    = 'web';
$framework = '_magma';
$js_lib    = '_lava';
$path_info = pathinfo($_SERVER['SCRIPT_NAME']);
$base_path = $path_info['dirname'];
print_r($base_path);

$paths = ['root'      => $base_path,
          'framework' => $framework,
          'js_lib'    => $js_lib,
          'medium'    => '/' . $medium,
          'uri'       => $_SERVER['REQUEST_URI']];

try {
    if (!include($paths['root'] . $paths['framework'] . '/core/AutoLoader.php')) {
        throw new Exception ('<b>Error - AutoLoader is missing</b>');
    }
    $loader   = new AutoLoader($paths);
    $appStack = new BootStrap($paths);
    $app      = new StartPage($paths, $appStack->getConfig());
    $app->start();
} catch (Exception $e) {
    echo
        '<p><b>EXCEPTION</b><br />Message: '
        . $e->getMessage()
        . '<br />File: '
        . $e->getFile()
        . '<br />Line: '
        . $e->getLine()
        . '</p>';
}

index then instantiates BootStrap, under ‘/framework/core’, and passes the above array through the constructor which sets it in the class itself.

BootStrap then instantiates StartPage, under ‘/framework/web’, and passes the paths array once again through the constructor.

StartPage then instantiates a class which sets the style-sheets, located under ‘/web/stylesheets’, using the paths variable, like so:

class CssInclusion {

    private $paths;
    private $include_css;

    public function __construct($paths, $include_css) {

        // set variables
        $this->paths = $paths;
        $this->include_css = $include_css;
    }

    public function loadStylesheets() {

        // set path
        $directory_path = $this->paths['root'] . $this->paths['medium']. '/stylesheets';

        // loop through stylesheet array
        foreach ($this->include_css as $stylesheet) {

            // include stylesheet, handle exceptions
            $file_path = $directory_path . '/' .  $stylesheet . '.css';
            print_r($file_path);
            try {
                if (!is_file($file_path)) {
                    throw new Exception ('<b>Error - missing stylesheet:</b> ' . $file_path . '<br />');
                }
                echo '<link rel="stylesheet" type="text/css" href="' . $file_path . '" />';
            } catch (Exception $e) {
                echo
                    '<p><b>EXCEPTION</b><br />Message: '
                    . $e->getMessage()
                    . '<br />File: '
                    . $e->getFile()
                    . '<br />Line: '
                    . $e->getLine()
                    . '</p>';
            }
        }
    }
}

I don’t get an exception, yet the style-sheet doesn’t load. It’s very weird. Can your fresh eyes see what I missed?

  • 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-17T08:08:46+00:00Added an answer on June 17, 2026 at 8:08 am

    Your root path is an absolute system path like srv/www.
    But a stylesheet path has to be a relative or absolute path that is accessible by the browser.

    http://yoursite/css or /css

    I get my basePath like so:

    $pathInfo = pathinfo($_SERVER['SCRIPT_NAME']);
    $basePath = $pathInfo['dirname'];
    

    Perhaps you only have to change that line:

    $directory_path = $this->paths['medium']. '/stylesheets';
    

    I don’t know what $this->paths['medium'] contains?!

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

Sidebar

Related Questions

Don't know if this is possible, but I have some code like this: val
Don't ask me how but I'm in a situation where I have DCPs published
I have just tried to save a simple *.rtf file with some websites and
Don't ask why but I have the requirement to draw a border around certain
Don't ask why, but is there any way to suppress a failed linking error?
Don't be frightened, its a very basic code. Just wanted to check with you
Don't they both have to convert to machine code at some point to execute
Don't know if I'm missing something here. I'd like to run multiple global variables
I don't want my user to even try downloading something unless they have Wi-Fi
Don't overthink this - there's a very commonly used term and I ... have

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.