title: PHP function not found with require_once in html
body: <p>I'm trying to execute a function in a file called 'function.php' into <code>&lt;?php ?&gt;</code> with a require_once, in HTML lines..</p>
  
  <p>accueil.php (C:\wamp\www\e-commerce\MusicStore\accueil.php) :</p>
  
  <pre><code>&lt;?php
  require_once('http://localhost/e-commerce/MusicStore/templates/function.php');
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
     &lt;body&gt;
        &lt;?php
        get_header();
        ?&gt;
     &lt;/body&gt;
  ....
  &lt;/html&gt;
  </code></pre>
  
  <p>and function.php (C:\wamp\www\e-commerce\MusicStore\templates\function.php ):</p>
  
  <pre><code>&lt;?php
  function get_header()
  {
      echo "&lt;header class=\"header\"&gt;
      &lt;div class=\"banniere\"&gt;
              &lt;a href=\"accueil.php\"&gt;&lt;img src=\"http://localhost/e-commerce/MusicStore/img/logo.png\" alt=\"banniere\"/&gt;&lt;/a&gt;
      &lt;/div&gt;
      &lt;/header&gt;";
  }
  ?&gt;
  </code></pre>
  
  <p>I got " Fatal error: Call to undefined function get_header() ".</p>
  
  <p>But if I put the echo outside of the function, it works.. This is only into the function It doesn't work.</p>
  
  <p>Does anybody know how to resolve this? I'm trying to clear my website with adding PHP function to structure my html page.</p>
  
  <p>EDIT : The double '{' is a mistake on Stackoverflow but isn't in the file.</p>