• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Help Guest hướng dẫn auto chèn head foot vào các file html trên Host với

Yeukodamnoi

New Member
Vip
Guest hướng dẫn giúp mình. Lên google tìm và làm theo nhưng không được.
 
thêm vào .htaccess
#Options -Indexes
ErrorDocument 402 /
ErrorDocument 403 /
ErrorDocument 404 /
ErrorDocument 500 /
AddDefaultCharset UTF-8
RewriteEngine on RewriteBase /
RewriteEngine On
RewriteRule ^(.*).(html|xhtml|xml)$ /auto.php?file=$1.$2 [L]
tạo file auto.php ngang hàng index,port code này vào
<?php
error_reporting(0);
$url = $_GET['file'];
$head = include'header.html';
if(file_exists($url)){
$url = file_get_contents($url);
$url = str_replace('<body>', '<body>'.$head, $url);
echo $url;
}else{
$url = file_get_contents('index.html');
$url = str_replace('<body>', '<body>'.$head, $url);
echo $url;
}
include'footer.html';
?>
Xong tạo header.html và footer.html ngang hàng index và post code là có thể auto head,foot file .html nhé.
 
Chẳng được bạn à. Nó chèn mỗi foot thôi,không có head và nội dung trang. Demo: http://VnNet.Org/***/loanluan
 
Tạo file auto.php va .htaccess ngang hàng với index.php à bạn. Liệu nó có hoạt động đối với các thư mục không. Hay là chỉ với file nằm trong thư mục chứa file đó.
 
Mấy bác ngu vãi.auto không dùng đi viết pó tay?pm chỉ auto head,footer cho.

----------> Bổ sung bài viết lúc 05:19 PM <----------> Bài viết trước lúc 05:18 PM <----------

Tạo head.html và foot.html đi...pm chỉ tip cho.
 
Mấy bác ngu vãi.auto không dùng đi viết pó tay?pm chỉ auto head,footer cho.
----------> Bổ sung bài viết lúc 05:19 PM <----------> Bài viết trước lúc 05:18 PM <----------
Tạo head.html và foot.html đi...pm chỉ tip cho.

có gì post ra đây cho mọi người có thắc mắc giống mình cùng xem đi bạn.
 
thêm vào .htaccess
tạo file auto.php ngang hàng index,port code này vào
Xong tạo header.html và footer.html ngang hàng index và post code là có thể auto head,foot file .html nhé.

Mình làm như trên thì có auto chèo head foot nhưng lại mất nội dung của trang html. Vào chỉ thấy head và foot thôi.
 

Facebook Comments

Similar threads

New posts New threads New resources

Back
Top