Hi all,
I want to include a header page and a footer page for all my web pages.
Header.php and Footer.php have the border design of my website, so for all my pages I have only to include Header.php and Footer.php then in between the 2 include statments, is the code of any page.
So, when I want to change anything to the border design of my website, I'll only change Header.php and Footer.php, not to change for all my website pages (32 pages)
Now, in the Header.php there is the HTML Body tag <body> and in each page of website the content of the body tag is different than the others, so I think the solution to my problem is to have the content of the body tag to be in a variable $BodyTag so I can assign its contents before including the Header.php then I can make the body tag changed dynamically depend on the body tag variable $BodyTag.
The problem Im facing is not in the declaration of the variable $BodyTag, the problem is in showing the variable, I tried (echo) and (eval) but still I can't see the content of the variable when I viewed the source.
Please install the 3 scripts and debug, AT THE END, ONE OF THE 2 FIELDS SHOULD BE FOCUSED.
Here're the 3 scripts again
Header.php
--------------
<html>
<BODY <? ob_start(); eval('?>' . $BodyTag); $value=ob_get_contents(); ob_end_clean();?>>
Footer.php
-------------
</body>
</html>
Test.php
----------
<?
$BodyTag = " if isset($_POST[UserID]) {?>onload\=\"document.FormName.Field1.focus()\"<?} else {?>onload\=\"document.FormName.Field2.focus()\"<? } ";
include("Header.php"
;
?>
<form name="FormName">
<input name="Field1">
<input name="Field2">
</form>
<?
include("Footer.php"
;
?>
Please help me.
I want to include a header page and a footer page for all my web pages.
Header.php and Footer.php have the border design of my website, so for all my pages I have only to include Header.php and Footer.php then in between the 2 include statments, is the code of any page.
So, when I want to change anything to the border design of my website, I'll only change Header.php and Footer.php, not to change for all my website pages (32 pages)
Now, in the Header.php there is the HTML Body tag <body> and in each page of website the content of the body tag is different than the others, so I think the solution to my problem is to have the content of the body tag to be in a variable $BodyTag so I can assign its contents before including the Header.php then I can make the body tag changed dynamically depend on the body tag variable $BodyTag.
The problem Im facing is not in the declaration of the variable $BodyTag, the problem is in showing the variable, I tried (echo) and (eval) but still I can't see the content of the variable when I viewed the source.
Please install the 3 scripts and debug, AT THE END, ONE OF THE 2 FIELDS SHOULD BE FOCUSED.
Here're the 3 scripts again
Header.php
--------------
<html>
<BODY <? ob_start(); eval('?>' . $BodyTag); $value=ob_get_contents(); ob_end_clean();?>>
Footer.php
-------------
</body>
</html>
Test.php
----------
<?
$BodyTag = " if isset($_POST[UserID]) {?>onload\=\"document.FormName.Field1.focus()\"<?} else {?>onload\=\"document.FormName.Field2.focus()\"<? } ";
include("Header.php"

?>
<form name="FormName">
<input name="Field1">
<input name="Field2">
</form>
<?
include("Footer.php"

?>
Please help me.