Library tutorials & articles
An Introduction to PHP
Server-side includes
A server side include is a file that is included within the current document on the server. This can save the developer a considerable amout of time. If all of the pages on your site have a similar header, you can include a single file containing the header into your pages. When the header needs updating, you only update the one page, which is included in all of the pages that use the header. As many include files may be used as required.
In PHP, server side includes are achieved using the require statement. The following example includes a banner that contains a logo and set of links for the pages.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Server Side Include</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<?php require("banner.html"); ?>
<p>
This page contains a banner that may be incuded in any
of the PHP files used on this site.
</p>
</body>
</html>
Related articles
Related discussion
-
PHP vs otherstuff
by James Crowley (8 replies)
-
Sendmail?
by gringod (6 replies)
-
ICQ SMS
by James Crowley (9 replies)
-
PHP Accessing an Access Database
by gringod (2 replies)
-
Writing to Access using IIS and ASP/PHP
by paulfp (6 replies)
Related jobs
-
Open Source Stack Application Server Administrator
in Luxemburg (€35K-€55K per annum) -
PHP Developer - Germany
in Koln (€35K-€60K per annum) -
Solutions Engineer
in Reading (£50K-£60K per annum) -
Senior Web Developer - Luxembourg
in Luxembourg (€45K-€70K per annum)
Here they show how to send valued in one file to another(both are in same folder)
but i need to send values in one folder to another
Yes, I think you're correct, although you could easily have a line like this:
to get around that problem. Which I think is what's missing from this tutorial
In the PHP file should it be "$_POST["num"]" ?
instead of just $num?
hello
I have in php a header which brings a save as box , but when file is down loaded it contains the 6 blank spaces at the start of of document .
I have to avoid storing these blank spaces.Please help me to solve this problem.
You can also do string concatenation like
$h = "Hello";
$w = "World";
$message = "$h $w";