0

I am trying to include a header which i made separately into my index page. When I try to include and run it, it does not display the header that I made although the paths are all correct. please help me on this. thanks. I am a newbie in php, css and html. Here is the link for pictures and codes: http://www.fileden.com/files/2011/7/27/3174077/My_Documents/Folder.rar

include code:

</head>
<body>
   <div id="main_container">

   <div>
      <?php

          include 'include/header2.php';

      ?>

        </div>

<div class="main_content">



    <div class="menu">
        <ul>
        <li><a class="current" href="../../index.php">Home</a></li>
        <li><a href="module/jo.php">Job Orders<!--[if IE 7]><!--></a><!--<![endif]-->
        <!--[if lte IE 6]><table><tr><td><![endif]-->
            <ul>

so on and so forth...

5
  • What output are you getting and have you turned on error reporting, if yes, are there any errors? Also, what does your header2.php look like? Commented Aug 12, 2011 at 21:57
  • have you enabled showing warnings and notices? (hint: you haven't) Commented Aug 12, 2011 at 21:57
  • @ancide... there is no error.. only that it does not display... I've checke the path and it's correct. I don't know why it does not show when i try to run it.. Commented Aug 12, 2011 at 22:50
  • @yi_H no i have not because i don't know. I'm sorry because I'm a newbie in php.. Commented Aug 12, 2011 at 22:51
  • look around here php.net/manual/en/book.errorfunc.php Commented Aug 12, 2011 at 22:58

2 Answers 2

2

I can only guess, but I think 'include/header2.php' is pointing at something other than what you intend it to. Take a look at the docs on include path. You can check your current include_path with phpinfo and work from there.

Sign up to request clarification or add additional context in comments.

Comments

0

Yeah, turn on error reporting and see what php is telling you. You can also try to give an absolute path for your include, like:

include('/var/web/include/header2.php');

It's not really advisable to use absolute paths like this, but it might help you find out what exactly is going wrong.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.