Jump to content

YndiaPaleAle

New Members
  • Posts

    3
  • Joined

  • Last visited

YndiaPaleAle's Achievements

Newbie

Newbie (1/5)

0

Reputation

1

Community Answers

  1. Oh yeah, I see. iIt seems, that I have to change the Document_root on the Synology WebStation. I tried this, configuration looks good, but still not working. I will investigate more in this WebStation topic and close this one. Thanks.
  2. Thanks for your answer. I understood, but still have problems (I am not a programmer, I just do this for fun for my website): https://www.swissbeerglasses.com/ I have this configuration: Root on server string(33) "/home/bierglae/www/Webseite.ch" Root local string(17) "/var/services/web" How can I solve the different $_SERVER["DOCUMENT_ROOT"] folder ? Now I have to include /Webseite.ch/ in the code (local not working without /Webseite.ch/: </header> <div> <a href="/index.php"><span class='Ub2'>Home</span></a> <img src='/Webseite.ch/src/img/favicon/new.jpg' alt='Neu' width= '35'> </div> </header> <head> <link rel="stylesheet" type="text/css" href="/Webseite.ch/src/css/styles.css"> </head> On the server not working this configuration too: <head> <link rel="stylesheet" type="text/css" href="/src/css/styles.css"> </head> Include needs this configuration, which just works local on my Synology NAS webserver. <?php include $_SERVER["DOCUMENT_ROOT"] . "/Webseite.ch/phpadds/head.php"; ?> <?php include $_SERVER["DOCUMENT_ROOT"] . "/Webseite.ch/phpadds/header.php"; ?> Sorry for this confusion, I have to find the "fist step"
  3. Hi I have a lack of understanding how root folder works, together with the option "include" files in different folders. This is my simple example (I taylored the problem): I have index.php in the root folder. <!DOCTYPE html> <html lang="de"> <?php include "./phpadds/head.php"; ?> <?php include "./phpadds/header.php"; ?> <body> <h1>Hello</h1> </body> </html> Here both include order (head.php and header.php works fine. header.php </header> <div> <a href="./index.php"><span class='Ub2'>Home</span></a> <img src='./src/img/favicon/new.jpg' alt='Neu' width= '35'> </div> </header> head.php <head> <link rel="stylesheet" type="text/css" href="./src/css/styles.css"> </head> The styles.css is defined in head.php and works too. h1 { text-align: center; color: red; } Now i create a new folder "google", there in copy the index.php from my root (root(google/index.php). Now both includes are not working, because they are not pointing to the right place. <?php include "./phpadds/head.php"; ?> <?php include "./phpadds/header.php"; ?> I can change them to: <?php include "../phpadds/head.php"; ?> <?php include "../phpadds/header.php"; ?> Now, header.php is visible, but then still styles.css and all other links inside head.php and header.php are not working, because the point to the false folder (./) What do I have for possibilities to manage this behaviour, so that links and includes are working ? Root on my local server and on my hosting server is not the same. Yves
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.