2011-11-08 192 views
12

我正在爲朋友設計一個相對簡單的網站。我想impliment PHP,以便他可以改變他的頁眉/頁腳,而不必回頭查看每個文件。問題是,我幾乎完全不熟悉php的工作原理。有沒有簡單的方法來做到這一點?我已經看到了一些關於如何製作php頭文件的答案,但它們看起來都不一樣,我也沒有取得太大的成功。我不是說他們不工作(我可能做錯了),但在這種情況下更簡單,越好。創建PHP頁眉/頁腳

謝謝!

+0

下面的答案應該會對你有所幫助,但是像smarty或者twig這樣的模板引擎可以在將來出現更大規模的麻煩時從這些混亂中拯救你很多......它有一個相對簡單的學習曲線,大量的HTML和一些變量... – optimusprime619

回答

15

只需創建header.php文件,並在你想用它做的事:

<?php 
include('header.php'); 
?> 

同樣的,頁腳。如果你只有html,你不需要這些文件中的php標籤。

查看更多有關包括在這裏:

http://php.net/manual/en/function.include.php

3

您可以在PHP中使用include_once()功能做到這一點。以header.php的名義構建標題部分並構建頁腳部分footer.php。最後將所有內容包含在一個文件中。

例如:

的header.php

<html> 
<title> 
<link href="sample.css"> 

footer.php

</html> 

所以最終的文件看起來像

include_once("header.php") 

body content(The body content changes based on the file dynamically) 

include_once("footer.php") 
31

而且只用include()include_once()包括頁眉和頁腳,我發現有用的一件事是能夠爲每個頁面包含一個自定義頁面標題或自定義標題標籤,但仍包含部分包含的標題。我通常做到這一點,如下所示:

在網站頁面:

<?php 

$PageTitle="New Page Title"; 

function customPageHeader(){?> 
    <!--Arbitrary HTML Tags--> 
<?php } 

include_once('header.php'); 

//body contents go here 

include_once('footer.php'); 
?> 

而且,在header.php文件:

<!doctype html> 
<html> 
    <head> 
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"> 
    <title><?= isset($PageTitle) ? $PageTitle : "Default Title"?></title> 
    <!-- Additional tags here --> 
    <?php if (function_exists('customPageHeader')){ 
     customPageHeader(); 
    }?> 
    </head> 
    <body> 

也許有點出乎你原來的問題的範圍,但是爲include提供更多的靈活性是有用的。

+0

我認爲它應該是** <php **而不是** <title><?= **。 – <span class="text-secondary"> <small> <a rel="noopener" target="_blank" href="https://stackoverflow.com/users/2311074/">Adam</a></span> <span></span> </small> </span> </p> </div> </div> </div> <div itemprop="comment" class="post-comment"> <div class="row"> <div class="col-lg-1"><span class="text-secondary">+2</span></div> <div class="col-lg-11"> <p class="commenttext">@Adam在[Short Tags](http://php.net/manual/en/ini.core.php#ini.short-open-tag)中,<<= ='相當於<php echo> )在PHP中啓用。 – <span class="text-secondary"> <small> <a rel="noopener" target="_blank" href="https://stackoverflow.com/users/351229/">William</a></span> <span></span> </small> </span> </p> </div> </div> </div> <div itemprop="comment" class="post-comment"> <div class="row"> <div class="col-lg-1"><span class="text-secondary">+0</span></div> <div class="col-lg-11"> <p class="commenttext">謝謝!很高興知道! – <span class="text-secondary"> <small> <a rel="noopener" target="_blank" href="https://stackoverflow.com/users/2311074/">Adam</a></span> <span></span> </small> </span> </p> </div> </div> </div> </div> </div> </article> <article class="board-top-1 padding-top-10"> <div class="post-col vote-info"> <span class="count">1<i class="fa fa-thumbs-up"></i></span> </div> <div class="post-offset"> <div class="answer fmt"> <blockquote> <p>越簡單越好。</p> </blockquote> <p>的index.php</p> <pre><code class="prettyprint-override"><? if (empty($_SERVER['QUERY_STRING'])) { $name="index"; } else { $name=basename($_SERVER['QUERY_STRING']); } $file="txt/".$name.".htm"; if (is_readable($file)) { include 'header.php'; readfile($file); } else { header("HTTP/1.0 404 Not Found"); exit; } ?> </code></pre> <p>的header.php存儲在<code class="prettyprint-override">txt</code>文件夾中的<code class="prettyprint-override">page</code></p> <pre><code class="prettyprint-override"><a href="index.php">Main page</a><br> <a href=?about>About</a><br> <a href=?links>Links</a><br> <br><br> </code></pre> <p>實際靜態的HTML頁面。HTM格式</p> </div> <div class="post-info"> <div class="post-meta row"> <p class="text-secondary col-lg-6"> <span class="source"> <a rel="noopener" target="_blank" href="https://stackoverflow.com/q/8066388">來源</a> </span> </p> <p class="text-secondary col-lg-6"> <span class="float-right date"> <span>2011-11-09 14:22:26</span> </p> <p class="col-12"></p> <p class="col-12"></p></div> </div> <!-- comments --> <div class="comments"> <div itemprop="comment" class="post-comment"> <div class="row"> <div class="col-lg-1"><span class="text-secondary">+0</span></div> <div class="col-lg-11"> <p class="commenttext">這是一個有趣的方法!你會用htaccess重寫,還是更簡單www.somesite.com/?about你還可以在txt文件夾中有一個目錄結構,還是基本名稱可以消除? – <span class="text-secondary"> <small> <a rel="noopener" target="_blank" href="https://stackoverflow.com/users/776695/">Ben</a></span> <span></span> </small> </span> </p> </div> </div> </div> <div itemprop="comment" class="post-comment"> <div class="row"> <div class="col-lg-1"><span class="text-secondary">+0</span></div> <div class="col-lg-11"> <p class="commenttext">是的,我更喜歡與mod_rewrite一起使用類似的方法,我甚至有一些我相信的代碼。如果沒有mod_rewrite,你必須使用'?page'方式來啓動。 – <span class="text-secondary"> <small> <span></span> </small> </span> </p> </div> </div> </div> </div> </div> </article> <div> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-6208739752673518" data-ad-slot="1038284119" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <article class="board-top-1 padding-top-10"> <div class="post-col vote-info"> <span class="count">0<i class="fa fa-thumbs-up"></i></span> </div> <div class="post-offset"> <div class="answer fmt"> <p>您可以用這個標題: <strong><em>重要:</em></strong>放在要包含內容的<strong>PHP</strong>頁以下。</p> <pre><code class="prettyprint-override"><?php //at top: require('header.php'); ?> <?php // at bottom: require('footer.php'); ?> </code></pre> <p>還可以包括導航欄globaly只是用這個代替:</p> <pre><code class="prettyprint-override"><?php // At top: require('header.php'); ?> <?php // At bottom: require('footer.php'); ?> <?php //Wherever navbar goes: require('navbar.php'); ?> </code></pre> <p>在header.php中:</p> <pre><code class="prettyprint-override"><!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> </head> <body> </code></pre> <p><strong>不要靠近身體或HTML標籤!</strong> <br> <strong>包含HTML瀏覽:</strong></p> <pre><code class="prettyprint-override"><?php //Or more global php here: ?> </code></pre> <p>Footer.php:</p> <p>代碼在這裏:</p> <pre><code class="prettyprint-override"><?php //code ?> </code></pre> <p>Navbar.php:</p> <pre><code class="prettyprint-override"><p> Include html code here</p> <?php //Include Navbar PHP code here ?> </code></pre> <h1>好用:</h1> <ul> <li>清潔主php文件(index.php)腳本。</li> <li>更改頁眉或頁腳。等改變它的所有頁面與包括 - 良好的所有網頁上的警報等...</li> <li>節省時間!</li> <li>更快的頁面加載!</li> <li>您可以根據需要包含儘可能多的文件!</li> <li>服務器雙面!</li> </ul> </div> <div class="post-info"> <div class="post-meta row"> <p class="text-secondary col-lg-6"> <span class="source"> <a rel="noopener" target="_blank" href="https://stackoverflow.com/q/47041162">來源</a> </span> </p> <p class="text-secondary col-lg-6"> <span class="float-right date"> <span>2017-10-31 17:24:00</span> </p> <p class="col-12"></p> <p class="col-12"></p></div> </div> </div> </article> </div> <div class="clearfix"> </div> <div class="relative-box"> <div class="relative">相關問題</div> <ul class="relative_list"> <li> 1. <a href="http://hk.uwenku.com/question/p-vdovdgqe-or.html" target="_blank" title="java創建頁眉和頁腳的pdf"> java創建頁眉和頁腳的pdf </a> </li> <li> 2. <a href="http://hk.uwenku.com/question/p-abmnoxlb-hk.html" target="_blank" title="PHP頁眉和頁腳"> PHP頁眉和頁腳 </a> </li> <li> 3. <a href="http://hk.uwenku.com/question/p-hmhhipfv-gt.html" target="_blank" title="Cognos頁眉/頁腳"> Cognos頁眉/頁腳 </a> </li> <li> 4. <a href="http://hk.uwenku.com/question/p-dccrsdfp-bcv.html" target="_blank" title="頁腳到頁眉"> 頁腳到頁眉 </a> </li> <li> 5. <a href="http://hk.uwenku.com/question/p-khsbpaqy-xt.html" target="_blank" title="創建自定義HTML頁面頁眉和頁腳"> 創建自定義HTML頁面頁眉和頁腳 </a> </li> <li> 6. <a href="http://hk.uwenku.com/question/p-nvvqftwc-bcq.html" target="_blank" title="爲我的角頁面創建複雜的頁眉和頁腳"> 爲我的角頁面創建複雜的頁眉和頁腳 </a> </li> <li> 7. <a href="http://hk.uwenku.com/question/p-hcxnsyuk-xm.html" target="_blank" title="如何用wordpress頁眉和頁腳創建靜態頁面?"> 如何用wordpress頁眉和頁腳創建靜態頁面? </a> </li> <li> 8. <a href="http://hk.uwenku.com/question/p-exbnchio-wz.html" target="_blank" title="PHP包括() - 頁眉和頁腳"> PHP包括() - 頁眉和頁腳 </a> </li> <li> 9. <a href="http://hk.uwenku.com/question/p-ktatgsqc-uq.html" target="_blank" title="PHP包含頁眉或頁腳位置"> PHP包含頁眉或頁腳位置 </a> </li> <li> 10. <a href="http://hk.uwenku.com/question/p-qskmeuyx-o.html" target="_blank" title="PHP頁眉和頁腳困惑"> PHP頁眉和頁腳困惑 </a> </li> <div> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-6208739752673518" data-ad-slot="4606349252"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <li> 11. <a href="http://hk.uwenku.com/question/p-mayiabrs-gy.html" target="_blank" title="使用CSS創建頁眉和頁腳以便打印"> 使用CSS創建頁眉和頁腳以便打印 </a> </li> <li> 12. <a href="http://hk.uwenku.com/question/p-tgoehdsw-gm.html" target="_blank" title="如何創建使用頁眉​​和頁腳部分的佈局"> 如何創建使用頁眉​​和頁腳部分的佈局 </a> </li> <li> 13. <a href="http://hk.uwenku.com/question/p-xgpggzsy-gq.html" target="_blank" title="在使用AlivePDF創建的PDF中添加頁眉和頁腳"> 在使用AlivePDF創建的PDF中添加頁眉和頁腳 </a> </li> <li> 14. <a href="http://hk.uwenku.com/question/p-mxzsvtdd-hg.html" target="_blank" title="創建一個響應式網格,頁眉和頁腳"> 創建一個響應式網格,頁眉和頁腳 </a> </li> <li> 15. <a href="http://hk.uwenku.com/question/p-cdwhhbst-tq.html" target="_blank" title="HTML創建與頁腳和頁眉和內容"> HTML創建與頁腳和頁眉和內容 </a> </li> <li> 16. <a href="http://hk.uwenku.com/question/p-bnyjrmdz-bms.html" target="_blank" title="如何在新的docx文檔中創建頁眉/頁腳?"> 如何在新的docx文檔中創建頁眉/頁腳? </a> </li> <li> 17. <a href="http://hk.uwenku.com/question/p-qsgupfdi-uh.html" target="_blank" title="內容頁眉頁腳"> 內容頁眉頁腳 </a> </li> <li> 18. <a href="http://hk.uwenku.com/question/p-yeokmekt-bns.html" target="_blank" title="頁眉和頁腳徽標"> 頁眉和頁腳徽標 </a> </li> <li> 19. <a href="http://hk.uwenku.com/question/p-oowrboac-cd.html" target="_blank" title="粘性頁眉和頁腳"> 粘性頁眉和頁腳 </a> </li> <li> 20. <a href="http://hk.uwenku.com/question/p-qxtbspiw-gy.html" target="_blank" title="頁眉和頁腳在"> 頁眉和頁腳在 </a> </li> <li> 21. <a href="http://hk.uwenku.com/question/p-xxpayemm-un.html" target="_blank" title="pdfkit頁眉和頁腳"> pdfkit頁眉和頁腳 </a> </li> <li> 22. <a href="http://hk.uwenku.com/question/p-yykdeyuv-zy.html" target="_blank" title="MS Excel XML頁眉頁腳"> MS Excel XML頁眉頁腳 </a> </li> <li> 23. <a href="http://hk.uwenku.com/question/p-nhrlgain-bbm.html" target="_blank" title="頁眉和頁腳衝突"> 頁眉和頁腳衝突 </a> </li> <li> 24. <a href="http://hk.uwenku.com/question/p-uhazhygt-cc.html" target="_blank" title="通用頁眉和頁腳"> 通用頁眉和頁腳 </a> </li> <li> 25. <a href="http://hk.uwenku.com/question/p-wqbitgyl-gd.html" target="_blank" title="獲取UITableView頁眉/頁腳"> 獲取UITableView頁眉/頁腳 </a> </li> <li> 26. <a href="http://hk.uwenku.com/question/p-rhfzkcke-yq.html" target="_blank" title="頁眉和頁腳XSL FO"> 頁眉和頁腳XSL FO </a> </li> <li> 27. <a href="http://hk.uwenku.com/question/p-bcneoauu-bcv.html" target="_blank" title="NSCollectionView與頁眉和頁腳"> NSCollectionView與頁眉和頁腳 </a> </li> <li> 28. <a href="http://hk.uwenku.com/question/p-ydvmjgwu-bmt.html" target="_blank" title="ReactJS頁眉和頁腳"> ReactJS頁眉和頁腳 </a> </li> <li> 29. <a href="http://hk.uwenku.com/question/p-slqohsig-no.html" target="_blank" title="固定頁眉和頁腳"> 固定頁眉和頁腳 </a> </li> <li> 30. <a href="http://hk.uwenku.com/question/p-vegflpch-qh.html" target="_blank" title="頁眉/頁腳/主代碼"> 頁眉/頁腳/主代碼 </a> </li> </ul> </div> <div> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-6208739752673518" data-ad-slot="1575177025"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <div class="padding-top-10"></div> </div> </div> <script type="text/javascript" src="http://img.uwenku.com/uwenku/script/side.js?t=1644592048261"></script> <script type="text/javascript" src="http://img.uwenku.com/uwenku/plugin/highlight/highlight.pack.js"></script> <link href="http://img.uwenku.com/uwenku/plugin/highlight/styles/docco.css" media="screen" rel="stylesheet" type="text/css" /> <script type="text/javascript"> $('pre').each(function(i, e) { hljs.highlightBlock(e, "<span class='indent'> </span>", false) }); </script> <div class="col-lg-3 col-md-4 col-sm-5"> <div id="rightTop"> <div class="row"> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-6208739752673518" data-ad-slot="5415218910" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <div class="row sidebar panel panel-default"> <div class="panel-heading font-bold"> 最新問題 </div> <div class="m-b-sm m-t-sm clearfix"> <ul class="side_article_list"> <li class="side_article_list_item"> 1. <a href="http://hk.uwenku.com/question/p-bacwjvuk-bar.html" target="_blank" title="觸發器在oracle2中相乘兩列"> 觸發器在oracle2中相乘兩列 </a> </li> <li class="side_article_list_item"> 2. <a href="http://hk.uwenku.com/question/p-mikdcmvo-wt.html" target="_blank" title="紅寶石適用看跌數組"> 紅寶石適用看跌數組 </a> </li> <li class="side_article_list_item"> 3. <a href="http://hk.uwenku.com/question/p-ycuwofaj-xg.html" target="_blank" title="如何將目標中生成的內容部署到帶有MSBuild的UWP應用程序中的AppX包中"> 如何將目標中生成的內容部署到帶有MSBuild的UWP應用程序中的AppX包中 </a> </li> <li class="side_article_list_item"> 4. <a href="http://hk.uwenku.com/question/p-pkzsguhh-wz.html" target="_blank" title="SQL Server:CASE和連接字符串"> SQL Server:CASE和連接字符串 </a> </li> <li class="side_article_list_item"> 5. <a href="http://hk.uwenku.com/question/p-nipjwnwn-yy.html" target="_blank" title="爲什麼css網格在IE和Edge中不起作用?"> 爲什麼css網格在IE和Edge中不起作用? </a> </li> <li class="side_article_list_item"> 6. <a href="http://hk.uwenku.com/question/p-nqufrtsz-ze.html" target="_blank" title="保持html頁面內svg的大小"> 保持html頁面內svg的大小 </a> </li> <li class="side_article_list_item"> 7. <a href="http://hk.uwenku.com/question/p-ybfrlzqz-xw.html" target="_blank" title="在R中設置kmeans的靜態中心"> 在R中設置kmeans的靜態中心 </a> </li> <li class="side_article_list_item"> 8. <a href="http://hk.uwenku.com/question/p-obibwibz-xp.html" target="_blank" title="我怎樣才能在沒有警告的情況下設置一個很長的長號碼?"> 我怎樣才能在沒有警告的情況下設置一個很長的長號碼? </a> </li> <li class="side_article_list_item"> 9. <a href="http://hk.uwenku.com/question/p-fmboewhr-yc.html" target="_blank" title="如何更改jSpinners的ArrayList中的值?"> 如何更改jSpinners的ArrayList中的值? </a> </li> <li class="side_article_list_item"> 10. <a href="http://hk.uwenku.com/question/p-ryzljqmv-wn.html" target="_blank" title="提取數據"> 提取數據 </a> </li> </ul> </div> </div> </div> <p class="article-nav-bar"></p> <div class="row sidebar article-nav"> <div class="row box_white visible-sm visible-md visible-lg margin-zero"> <div class="top"> <h3 class="title"><i class="glyphicon glyphicon-th-list"></i> 相關問題</h3> </div> <div class="article-relative-content"> <ul class="side_article_list"> <li class="side_article_list_item"> 1. <a href="http://hk.uwenku.com/question/p-vdovdgqe-or.html" target="_blank" title="java創建頁眉和頁腳的pdf"> java創建頁眉和頁腳的pdf </a> </li> <li class="side_article_list_item"> 2. <a href="http://hk.uwenku.com/question/p-abmnoxlb-hk.html" target="_blank" title="PHP頁眉和頁腳"> PHP頁眉和頁腳 </a> </li> <li class="side_article_list_item"> 3. <a href="http://hk.uwenku.com/question/p-hmhhipfv-gt.html" target="_blank" title="Cognos頁眉/頁腳"> Cognos頁眉/頁腳 </a> </li> <li class="side_article_list_item"> 4. <a href="http://hk.uwenku.com/question/p-dccrsdfp-bcv.html" target="_blank" title="頁腳到頁眉"> 頁腳到頁眉 </a> </li> <li class="side_article_list_item"> 5. <a href="http://hk.uwenku.com/question/p-khsbpaqy-xt.html" target="_blank" title="創建自定義HTML頁面頁眉和頁腳"> 創建自定義HTML頁面頁眉和頁腳 </a> </li> <li class="side_article_list_item"> 6. <a href="http://hk.uwenku.com/question/p-nvvqftwc-bcq.html" target="_blank" title="爲我的角頁面創建複雜的頁眉和頁腳"> 爲我的角頁面創建複雜的頁眉和頁腳 </a> </li> <li class="side_article_list_item"> 7. <a href="http://hk.uwenku.com/question/p-hcxnsyuk-xm.html" target="_blank" title="如何用wordpress頁眉和頁腳創建靜態頁面?"> 如何用wordpress頁眉和頁腳創建靜態頁面? </a> </li> <li class="side_article_list_item"> 8. <a href="http://hk.uwenku.com/question/p-exbnchio-wz.html" target="_blank" title="PHP包括() - 頁眉和頁腳"> PHP包括() - 頁眉和頁腳 </a> </li> <li class="side_article_list_item"> 9. <a href="http://hk.uwenku.com/question/p-ktatgsqc-uq.html" target="_blank" title="PHP包含頁眉或頁腳位置"> PHP包含頁眉或頁腳位置 </a> </li> <li class="side_article_list_item"> 10. <a href="http://hk.uwenku.com/question/p-qskmeuyx-o.html" target="_blank" title="PHP頁眉和頁腳困惑"> PHP頁眉和頁腳困惑 </a> </li> </ul> </div> </div> </div> </div> </div> </div> </div><!-- wrap end--> <!-- footer --> <footer id="footer"> <div class="bg-simple lt"> <div class="container"> <div class="row padder-v m-t"> <div class="col-xs-8"> <ul class="list-inline"> <li><a href="http://hk.uwenku.com/contact">聯系我們</a></li> <li>© 2020 HK.UWENKU.COM</li> <li><a target="_blank" href="https://beian.miit.gov.cn/">沪ICP备13005482号-4</a></li> <li><script type="text/javascript" src="https://v1.cnzz.com/z_stat.php?id=1280101193&web_id=1280101193"></script></li> <li><a href="http://www.uwenku.com/" target="_blank" title="优文库">简体中文</a></li> <li><a href="http://hk.uwenku.com/" target="_blank" title="優文庫">繁體中文</a></li> <li><a href="http://ru.uwenku.com/" target="_blank" title="поле вопросов и ответов">Русский</a></li> <li><a href="http://de.uwenku.com/" target="_blank" title="Frage - und - antwort - Park">Deutsch</a></li> <li><a href="http://es.uwenku.com/" target="_blank" title="Preguntas y respuestas">Español</a></li> <li><a href="http://hi.uwenku.com/" target="_blank" title="कार्यक्रम प्रश्न और उत्तर पार्क">हिन्दी</a></li> <li><a href="http://it.uwenku.com/" target="_blank" title="IL Programma di chiedere Park">Italiano</a></li> <li><a href="http://ja.uwenku.com/" target="_blank" title="プログラム問答園区">日本語</a></li> <li><a href="http://ko.uwenku.com/" target="_blank" title="프로그램 문답 단지">한국어</a></li> <li><a href="http://pl.uwenku.com/" target="_blank" title="program o park">Polski</a></li> <li><a href="http://tr.uwenku.com/" target="_blank" title="Program soru ve cevap parkı">Türkçe</a></li> <li><a href="http://vi.uwenku.com/" target="_blank" title="Đáp ứng viên">Tiếng Việt</a></li> <li><a href="http://fr.uwenku.com/" target="_blank" title="Programme interrogation Park">Française</a></li> </ul> </div> </div> </div> </div> </div> </footer> <!-- / footer --> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?f78a970f17b19a79fc477a3378096f29"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> </body> </html>