Doom87 wrote:How did u get it to work?
I created one file called mytest1.php:
<?php
include("mytest2.php");
echo "<html>";
echo "<head>";
echo "<title>". $sitename . "</title>";
echo "</head>";
echo "<body>";
dochead();
and then a second, called mytest2.php:
<?php
global $sitename, $banner, $bannerw, $bannerh;
$sitename = "MY Site";
$banner = "images/banner.png";
$bannerw = "760";
$bannerh = "120";
function dochead() {
global $banner, $bannerw, $bannerh, $sitename;
echo "<div align='center'>";
echo "<img src='$banner' width='$bannerw' height='$bannerh' alt='$sitename'>";
echo "</div>";
}
I then visited mytest1.php in a browser. Though the image didn't display for obvious reasons, it did generate the correct HTML.
(EDIT: By the way... you do realize that multiple calls to [man]echo[/man], such as in the first script, don't output data on new lines, but rather cram it all together as if you had one long echo statement... right?)