Announcement

Collapse
No announcement yet.

$header template question ...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • $header template question ...

    folks I am hopefully someone here can assist me.

    I am trying to have the header template include the same header file that I use on the rest of my site.

    If I put:

    include('include/header.php');

    in the header template, the code looks like it should in my web browser. However, when I view the source it seems that instead of inserting the code below the <BODY> tag, it has inserted it at the very top of the page ... even before the DTD declaration.

    Alternately, if I make all the code in the include file the value of the variable $header, ( i.e. $header = "all html, php stuff here"; ) then the code shows up in the correct space, but it wont let me include any other files from that one.

    Does anyone know what I might be doing incorrectly? I can't seem to figure out why the code shows up above the <HTML> tag, etc ...

    any and all help is most appreciated. Feel free to email me if you need any specific information.

    Thanks

    Gordon
    [email protected]

  • #2
    $header = implode('', file("http://www.domain.com/include/file.php"));

    is the easiest way to explain.

    Comment


    • #3
      not exactly working ...

      ok ... I tried what you suggested and what was displayed was very odd ... while the code was located in the right place, it looks like the PHP code was not parsed (lots of echo statements and the like displayed)

      $header = implode('',file("include/header.php"));

      is what I entered.

      Any idea?

      thanks

      gordon

      Comment


      • #4
        As I said, you need the http:// part.

        Or if you have PHP4 you can use output buffering. Search for ob_start.

        Comment


        • #5
          it works!

          Thanks for the pointer ... I got it working correctly now

          Appreciate the assistance.

          gordon

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X