0
votes

i have a website which has this structure:

  • /ROOT DIRECTORY/
    • Product/
      • products.php
  • CSS/

    • style.css
  • index.php

so here's the problem: index.php links the style.css with relative path like so "../CSS/style.css"

and products.php includes index.php using include "../index.php"
but the css isn't being included because NOW index.php is in the same folder as products.php so relative path won't work !!
is there any solution a part from absolute path because i don't want people to know the structure of my project if there is not can you give me the absolute path or can i somehow hide the absolute path from the user


thank you in advance for your time

1
How would absolute paths reveal something of your structure that can't be deduced from relatives? Or what does the structure even matter? - Sami Kuhmonen
Apart from this: using relative paths carries nearly the same information, apart from the absolute base path. - arkascha

1 Answers

1
votes

try to use this syntax:

<link rel="stylesheet" type="text/css" href="/CSS/style.css">