header and footer php script - Blogging for Beginners learn Seo online free step by step

header and footer php script

This script is created for you to be able to include 1 file in another file. The most common use for this script is to serve as a Header/Footer. This will include an entire file with just 1 simple command. NOTE: if you are trying to include a file in HTML you must have SSI enabled on your server. Most servers today have PHP installed for free so if you need this functionality, consider switching to another language.
header and footer php script


Include in PHP

Just include the following code where you want to include a file in a .php file.

<? include "file.html" ?>

Include in ASP

Just include the following code where you want to include a file in a .asp file.

<!-- #include file="file.html" -->

Include in CGI

To include a file in a .cgi or .pl page, use the following code.

#!/usr/local/bin/perl

$footer_file = "/path/to/footer.txt";


print "Content-type: text/html\n\n";
open(FILE,"$footer_file");
while() {
print $_;
}
exit;

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.