Server Side Includes

A server-side include is a coding that you can include within your HTML document that will tell the web server to include other information with the document being served.
    Server side includes are a handy way to include information on your pages automatically. For example, you can use an #INCLUDE statement to display the header and footer of your pages automatically and make sure that each page displays the same information. You can save time by using a single header.html or footer.html file if this information changes. You can also use server side includes for graphics such as logos or image maps that should appear on multiple pages.
    You will need to use the .shtml extension for pages using the server side include (those that have #INCLUDE statements) for accounts hosted on Webserve. The file that is being included can have other extensions, such as .html.
    Please note that for security reasons, the EXEC server side include is NOT enabled on Webserve. The EXEC command is often used to run a cgi or perl program from a web page, but this function is not enabled on Webserve.

Using Server Side Includes with files in the same directory

To use a server side include, use the #include statement. This command tells the server to include another file, and tells it the file name that should be included:

    <!--#include FILE="filename.html"-->

This page uses server side includes to display the Webmaster banner and header information. An example of the command used is:

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

In this example it is placed in the body of the document, immediately after the <BODY> tag. One thing about SSI includes is the process of including. It takes two separate files and creates one whole file. What the server does is actually to take the SSI page and physically inserted it into the page calling it.
Related Posts:
  • $_GET , $_POST,$_COOKIE?? $_GET contains any variables provided to a script through the GET method.  $_POST contains any variables provided to a script through the POST method.  $_COOKIE contains any variables provided to a script through a… Read More
  • php interview questions PHP Interview Questions and Answers Click  this  link   … Read More
  • Cookies Versus Sessions?  Cookies The setcookie( ) call needs to be before the HTML form because of the way the web works. HTTP operates by sending all "header" information before it sends "body" information. In the header, it sends t… Read More
  • php file_get_contents This function is the preferred way to read the contents of a file into a string. The function itself does nothing but puts the source of the web page you supply it into a string available for us… Read More
  • Pagination in PHP and MySQL <?php function pagination($per_page = 10, $page = 1, $url = '', $total){ $adjacents = "2"; $page = ($page == 0 ? 1 : $page); $start = ($page - 1) * $per_page; $prev = $page - 1; $next = $page + 1; $lastpage = ceil… Read More
  • Cannot modify header information Check that <?php is at the very start of the functions.php file (before any whitespace) and remove ?> at the end of that file. header or setcookie or anything else that sends HTTP headers has  to be done before&n… Read More
  • What are the different tables present in mysql? Total 5 types of tables we can create 1. MyISAM 2. Heap 3. Merge 4. InnoDB 5. ISAM 6. BDB MyISAM is the default storage engine … Read More
  • How we know browser properties? echo $_SERVER['HTTP_USER_AGENT']; $browser = get_browser(); foreach ($browser as $name => $value) { echo “$name $value \n”; } get_browser   returns the capabilities of the user's browser. … Read More
  • thumbnail creation PHP script   To create a thumbnail, first check file entenson, and then read in the file using the imagecreatefromjpeg() or imagecreatefrompng() or imagecreatefromgif() function and can calculate the new thumbnail size. imag… Read More
  • php exec The exec() function is one of several functions you can use to pass commands tothe shell. The exec() function requires a string representing the path to the commandyou want to run, and optionally accepts an array variable th… Read More
  • How get the value of current session id? Session_id() returns the session id for the current session. … Read More
  • PHP? PHP (Hyper text Pre Processor) is a scripting language commonly used for web applications … Read More
  • Associative Arrays? You can use string values as keys. For example, you might create an arraylike this: $myStuff = array();$myStuff[“name”] = “andy”;$myStuff[“email”] = “andy@fsdsd.ca”;Print $myStuff[“name”]; Associative arrays are different t… Read More
  • mod_rewrite? Rewrites the requested URL on-the-fly based on configuration directives and rules. You are using system paths. Apache mod_rewrite only works with URLs,   RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} … Read More
  • What is LAMP? LAMP means combination of Linux, Apache, MySQL and PHP. … Read More