Results 1 to 8 of 8

Thread: php question

  1. #1

    php question

    hello all,

    ok, first go to , i made that site using php and i basically have made my site a template, so i add headerik.php, leftside.php, my html for the page and then i add my footer.php last.

    my problem is this: i'm trying to add another level of pages on my site, but for some reason it's not working with my templated php pages. if you go to you'll see what i'm talking about. my php coding is: <?php
    include $_SERVER['DOCUMENT_ROOT']."/headerik.php";
    ?>, should i be adding something in the file name???

    i hope i'm explaining myself for you to understand. thanks for your help.


  2. #2
    Your css file has a relative path in the include file. It is looking for which does not exist. Try using an absolute path for it ie.

  3. #3


    i'm sorry i don't follow


  4. #4
    I imagine your include file has a line that looks like this in it:
    PHP Code:
     <link href="custom.css" rel="stylesheet" type="text/css"
    this is a relative path it looks for custom.css in whatever directory you are in

    Change it to:
    PHP Code:
     <link href="/custom.css" rel="stylesheet" type="text/css"
    this is an absolute path. it looks for custom.css in the root directory.

    All your links will probably need to be changed in the include file to be absolute paths too.
    so href="aboutus.php" becomes href="/aboutus.php"

  5. #5
    Join Date
    Sep 2003
    <?php include('filename.php'); ?>
    AIM: GopherDesign
    ICQ: 39 401 865

  6. #6

    thank you

    thanx baumer1122 for being a little bit more clear, it helped. wow, i'm still amazed at the power of a dash (/).

    thank you again.


  7. #7
    That's a slash
    This is a dash -
    Welcome to the wonderful world of web programming

  8. #8

    my bad

    that is too funny - (dash) duh!(exclamation point)



Posting Permissions

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