Thursday, October 04, 2018

PHP - File Path Technique

Example of file path techniques. Breaking a few part from a index.php

1. header.php
2. footer.php
3. index.php

→ header.php
<!-- Header Page -->

<!doctype html>

<html lang="en">
    <title>eSeong Page</title>
    <meta charset="utf-8">

      <h1>Welcome to eSeong Page</h1>

        <li><a href="index.php">Home</a></li>
 → footer.php
<!-- Footer Page -->
  &copy; <?php echo date('Y'); ?> eSeong

 → index.php
<!-- Index Page -->
<?php include('header.php'); ?>

<div id="content">

<?php include('footer.php'); ?>
Preview page as below :

If you can't get the page working, please let me know the error in comment.

No comments: