]> git.bochard.net Git - mysite.git/commitdiff
fixed default path for php external embed
authorbochard <mail@tenkyuu.dev>
Sat, 26 Apr 2025 03:03:23 +0000 (11:03 +0800)
committerbochard <mail@tenkyuu.dev>
Sat, 26 Apr 2025 03:03:23 +0000 (11:03 +0800)
index.php
info.php
links.php
projects/index.php
sitemap.php

index 6ca785a2478338a7fec13f5dda3d7b51d2ab6e1f..e290c16d41da13034f458b88d6ec78a06adf80dc 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -1,3 +1,8 @@
+<?php\r
+  $path = $_SERVER['DOCUMENT_ROOT'];\r
+  $path .= '/includes';\r
+?>\r
+\r
 <!DOCTYPE html>\r
 <html lang="en">\r
 <head>\r
 </style>\r
 </head>\r
 <body>\r
-  <?php include './includes/header.php';?>\r
+<?php include_once($path . '/header.php');?>\r
 \r
   <main>\r
     <img src="/images/gifs/titles/homepageburning.gif" class="page-title">\r
-    <?php include './includes/nav.php';?>\r
+    <?php include_once($path . '/nav.php');?>\r
     <section style="text-align: center;">\r
       <h1>You found my net home!</h1>\r
       <p>Hi! welcome to my net home.</p>\r
     </section>\r
   </main>\r
 \r
-  <?php include './includes/footer.php';?>\r
+  <?php include_once($path . '/footer.php');?>\r
 </body>\r
 </html>
\ No newline at end of file
index e4930094e018f04702078926c0672295dbf56125..5095ed500c9825e618f506726688492ef0271299 100644 (file)
--- a/info.php
+++ b/info.php
@@ -1,3 +1,8 @@
+<?php
+  $path = $_SERVER['DOCUMENT_ROOT'];
+  $path .= '/includes';
+?>
+
 <!DOCTYPE html>
 <html lang="en">
 <head>
   <link rel="stylesheet" href="/styles/root.css">
 </head>
 <body>
-  <?php include './includes/header.php';?>
+  <?php include_once($path . '/header.php');?>
 
   <main>
     <img src="/images/gifs/titles/infopageburning.gif" class="page-title">
-    <?php include './includes/nav.php';?>
+    <?php include_once($path . '/nav.php');?>
     <section style="text-align: center;">
       <h1>About me!</h1>
       <p>Sorry, nothing to see here yet :&lt;</p>
     </section>
   </main>
 
-  <?php include './includes/footer.php';?>
+  <?php include_once($path . '/footer.php');?>
 </body>
 </html>
\ No newline at end of file
index 45ddc33494c1bdac012a64124b28f08f77a1f938..b33a23050a187084964df680bc214c50233ed4a5 100755 (executable)
--- a/links.php
+++ b/links.php
@@ -1,3 +1,8 @@
+<?php
+  $path = $_SERVER['DOCUMENT_ROOT'];
+  $path .= '/includes';
+?>
+
 <!DOCTYPE html>
 <html lang="en">
 <head>
   <link rel="stylesheet" href="/styles/root.css">
 </head>
 <body>
-  <?php include './includes/header.php';?>
+  <?php include_once($path . '/header.php');?>
 
   <main>
     <img src="/images/gifs/titles/linkspageburning.gif" class="page-title">
-    <?php include './includes/nav.php';?>
+    <?php include_once($path . '/nav.php');?>
     <section style="text-align: center;">
       <h1>Some useful links.</h1>
       <p>Sorry, nothing to see here yet :&lt;</p>
     </section>
   </main>
 
-  <?php include './includes/footer.php';?>
+  <?php include_once($path . '/footer.php');?>
 </body>
 </html>
\ No newline at end of file
index eb9f557cfbe9b0bcc2897208befe3db93cedad34..2172d26d77e66af19b68304c2e52fb63e9734400 100755 (executable)
@@ -1,3 +1,8 @@
+<?php
+  $path = $_SERVER['DOCUMENT_ROOT'];
+  $path .= '/includes';
+?>
+
 <!DOCTYPE html>
 <html lang="en">
 <head>
   <link rel="stylesheet" href="/styles/root.css">
 </head>
 <body>
-  <?php include '/includes/header.php';?>
+  <?php include_once ($path . '/header.php');?>
 
   <main>
     <img src="/images/gifs/titles/projectspageburning.gif" class="page-title">
-    <?php include '/includes/nav.php';?>
+    <?php include_once ($path . '/nav.php');?>
     <section style="text-align: center;">
       <h1>My projects' list</h1>
       <p>below are some of the coding projects I made, some of them are left unfinished.</p>
@@ -46,6 +51,6 @@
     </section>
   </main>
 
-  <?php include '../includes/footer.php';?>
+  <?php include_once ($path . '/footer.php');?>
 </body>
 </html>
\ No newline at end of file
index 069c9e3b3d756d906e0c20556445e758b4679e61..49f12e1227a9783c6783a02da002ec470ac4698b 100755 (executable)
@@ -1,3 +1,8 @@
+<?php
+  $path = $_SERVER['DOCUMENT_ROOT'];
+  $path .= '/includes';
+?>
+
 <!DOCTYPE html>
 <html lang="en">
 <head>
   <link rel="stylesheet" href="/styles/root.css">
 </head>
 <body>
-  <?php include './includes/header.php';?>
+  <?php include_once($path . '/header.php');?>
 
   <main>
     <img src="/images/gifs/titles/sitemappageburning.gif" class="page-title">
-    <?php include './includes/nav.php';?>
+    <?php include_once($path . '/nav.php');?>
     <section style="text-align: center;">
       <h1>All paths to my site.</h1>
       <p>Sorry, nothing to see here yet :&lt;</p>
     </section>
   </main>
 
-  <?php include './includes/footer.php';?>
+  <?php include_once($path . '/footer.php');?>
 </body>
 </html>
\ No newline at end of file