-1
I load the CSS this way:
<link href="../css/style.css" rel="stylesheet">
But I’d like to give you a different reference, something like:
<link href="<?php echo $_SESSION['caminho_completo']."css/style.css"?>" rel="stylesheet">
But when I do this the CSS doesn’t click on the page, what solution would you have for this?
Obs: works on the home.php that is inside the pages folder, but does not work for the files that are inside the 1998 folder.
"first way also not charging, I believe it is some problem with the way" ... First you need to set the course, then resolve the session issue, otherwise it will be difficult until you test. It would be good [Edit] the question and why the HTML excerpt resulting from its second example.
– Bacco
if I can solve without using the session will be good
– V.Avancini
Have you tried putting the path from the root? (starting from the bar):
/caminho/completo/css/style.css
- And before testing on <link> try at least to access directly through the browser by typing the address in the address bar. For example, if your site ishttp://example.com
and you can access your CSS byhttp://example.com/assets/css/style.css
, the way from the root would be:href="/assets/css/style.css"
– Bacco
@That’s why I tried to use Septic, to go the whole way, but it didn’t work. I can access the CSS with this link "http://localhost/PMI-WEB-CONTAB-ALPHA/css/style.css"
– V.Avancini
Take a look at the source code (CTRL+u) and see what appears where the SESSION is. So you check what value is passing and if the path is correct.
– Sam
@dvd the path looks like this: <link href="C: xampp htdocs PMI-WEB-CONTAB-ALPHA css/style.css" rel="stylesheet"> I don’t know if there would be any problem if the bars were inverted. The way is right
– V.Avancini
Yes. You want to link from the local server to a file on the computer?
– Sam
I don’t know if I understood very well what you meant... but the intention is to use CSS in my system pages
– V.Avancini
In the files inside the "pages" folder the path should be ".. /css/style.css", in the "1998" folder should be ".. /.. /css/style.css"
– Sam
the problem is that it is inside the header.php and the same is included in all the files: include("header.php"), both in the home that is inside the pages and in the files that are inside 1998
– V.Avancini