News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

I'm not 100% sure how to word this..

Started by Luis-, November 19, 2016, 12:40:13 PM

Previous topic - Next topic

Luis-

Hey.

Unfortunately, I couldn't think of a suitable title for this problem.

The problem I'm having is putting files in folders, for example, I have a few admin files (which are coded in PHP), and they're in their own admin folder, and I also have a few other php files which are located in a folder called server. The dilemma I'm having is that the stylesheet won't show on some pages.

I use two php files which are called header.php & footer.php so I don't have to edit all the files one by one, I can just edit the header.php or footer.php, so the stylesheet is being fetched from the header.php like this;

<link rel="stylesheet" type="text/css" href=<?php __DIR__ ?> "/sfse/home/stylesheets/style.css" />
<link rel="stylesheet" type="text/css" media="screen" href=<?php __DIR__ ?> "/sfse/home/stylesheets/menu_css.css" />

but that is also in it's own folder called stylesheets.

How can I make it so it loads correctly?

TemplateJuggler

I suspect you solved this problem since, but if not, let me know.

Kindred

Basically, you load style sheets, etc through URL not path...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

JeanpaulFX

You have to load css files by url like this,
<link href="assets/css/mystyles.css" rel="stylesheet" type="text/css" />

If you load from external hosts, then use the exact url with domain name and all that stuff.

Advertisement: