0

I want to include a page at the top of my page.

But when I do it. my header Is replaced with The page header.

For example, my Title Is replaced with The page Title.

How do I fix it ?

the included page header :

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Retrieving video details</title>
<style>
img {
  padding: 2px; 
  margin-bottom: 15px;
  border: solid 1px silver; 
}
td {
  vertical-align: top;
}
</style>
  </head>
2
  • 2
    show some code. we are not blind. Commented Aug 1, 2013 at 10:43
  • Did my answer help any? Commented Aug 1, 2013 at 10:56

2 Answers 2

1

Your best bet would be to remove that page's header so that it doesn't override yours OR set your header after you load in the included file to make yours overwrite the included page's header. If you get it externally from another domain I'm afraid you're stuck.

Edit: remove the <title> tags from the included page's source code if you can. Otherwise, include the file and set <title>Your Title</title> after it.

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

2 Comments

can i dont remove the title ?
@user2563494 Well, ofcourse you can "don't remove the title", since it's the same as not removing the title. Only you know wether or not you can remove the title in that page.
1

I have one solution to this problem that worked for me.

  1. Create a page and inside that page create a function

     <?php 
     function createHeader($title,$desc1,$keywords)
     { 
         ?>
     <!DOCTYPE html>
     <html lang="zxx">
     <head>
        <title>.....</title>
        <link>--------</link>
       -----------------------
     </head>
    
  2. Call this function. E.g.

    <?php 
            //I include this page in my another page that's why i write this condition
        if($news!="tech-headlines"){  
            include'header.php';  // include header file in this page
            createHeader();       // call header function
        }
      ?>
    
  3. write your code inside the body

    <body>
     -------------
     -------------
    </body>
    
  4. This page I have included in another page excluding header (access only inside the body code) or when I run this page individual it runs including header

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.