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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:02:42+00:00 2026-05-24T14:02:42+00:00

I wrote a small MVC app for a small website I am working on.

  • 0

I wrote a small MVC app for a small website I am working on. I created a load method that loads the header, footer, and the specified view file. I am having issues to where the header is not loading all of the JS files and the entire document’s HTML structure is missing indents.

Header.php:

 <!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="utf-8">
   <title><?php echo $meta['title']; ?></title>

   <?php //load all of the css files
        foreach (glob("layout/css/*.css") as $css_filename)
            { 
              echo  '<link rel="stylesheet" href="'.INSTALL_PATH.'/'.$css_filename.'">';
            }


        //load all of the js files 
        foreach (glob("layout/js/*.js") as $js_filename)
            { 
              echo '<script src="'.INSTALL_PATH.'/'.$js_filename.'"></script>';
            }


        ?>
</head>
<body>

Renders as:

<!DOCTYPE html> 
<html lang=en> 
<head> 
<meta charset=utf-8> 
<title>Test Title</title> 
<link rel=stylesheet href="/labs/wpsm/layout/css/style.css"><script></script></head> 
<body> 

One weird thing that I discovered is that if I include random text before the doctype declaration, everything is back to normal.

With extra character:

 s
    <!DOCTYPE html>
    <html lang="en">
    <head>
       <meta charset="utf-8">
       <title>Test Title</title>
       <link rel="stylesheet" href="/labs/wpsm/layout/css/style.css"><script src="/labs/wpsm/layout/js/test.js"></script></head>
    <body>

What am I missing here? I checked the character encoding of the page and it is utf-8. Any help or pointers would be awesome!

  • 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-24T14:02:43+00:00Added an answer on May 24, 2026 at 2:02 pm

    Just figured it out as I was messing around with the server. I discovered that it had mod_pagespeed enabled, I disabled the mod_pagespeed module (Google Page Speed for Apache) and it fixed the indenting and the JS file starting working. The module was automatically removing the JS file because it was a blank file I had put into the directory just to make sure the PHP was pulling the files properly. Thank you everyone for the help and I hope this helps someone save a few fistfuls of hair.

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

Sidebar

Related Questions

I wrote a small app that turns out to be using a lot of
Wrote a small app that accesses a bunch of search websites and puts the
I wrote a small PHP application several months ago that uses the WordPress XMLRPC
I wrote a small PHP application that I'd like to distribute. I'm looking for
We wrote a small Windows class library that implements extension methods for some standard
I wrote a small internal web app using (a subset of) pylons . As
I wrote a small program, that creates files at an interval of 1 minute.
I wrote small service class and I want implement something like that : service
I wrote a small app with Sinatra and have some admin routes (/admin/new, admin/edit/2,
I wrote a small executable in C# .NET that manages a .jar file. Our

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.