Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP include('includes/dheader.php'); problem with path

    Below are the example please help me on this my css not working any many more links in the dheader

    File List
    www.example.com/includes/dheader.php
    www.example.com/assets/css/dstyle.css
    www.example.com/index.php : include('includes/dheader.php');* css working
    www.example.com/category/books.php :include('../includes/dheader.php');
    *css not working


    dheader script

    PHP Code:
    <head>
    <
    meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <
    title>Books Store</title>
    <
    meta name="Description" content="Book Store">
        
    <
    link rel="stylesheet" href="assets/css/dstyle.css">

    </
    head
    Please help on this script to make links on dheader works in all sub directory

    Thanks in advance

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Code:
    <link rel="stylesheet" href="/assets/css/dstyle.css">
    to make it relative to the domain rather than the current page.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you very this does work .I have spend alot of time doing the ini set include path nothing works

    Thanks alot again.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •