• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

ok, so, php

Carl

New Member
well,

what i want to do is i'm using php in a similar fashion to shtml but i want to insert a variable called $header in the main bit of the page and read it off the header file.
 
Do you mean having a vaiable winin the header file?

header.php
<?
$var="some variable";
?>


main.php
<?
require("header.php");

echo $var;
?>
 
make a header.php and a footer.php. then everypage you make just name it with a .php extension and use the include() function to call header.php and footer.php
EX:
<? include("header.php") ?>
your html code or whatever here
<? include("footer.php") ?>



[Edited by razor on 11-26-2000 at 09:51 AM]
 
Back
Top