Hi! In some website code I have at the top of the HTML file a PHP include of another html file as such:
<?php
include("template1.html");
?>
I am trying to do the following:
<?php
$PageTitle = "My Page title";
include("template1.html");
?>
Then inside template1.html use the defined PHP variable in this way:
echo "<title> $PageTitle </title>;
Should this work?
Regards,
JohnD
Of the answers provided by Jacer12 below (thanks!) #2 worked and #1 did not. Not sure what the issue is with #1. Also, It seems I cannot rate the answer or select best answer since I am level1.
<?php
include("template1.html");
?>
I am trying to do the following:
<?php
$PageTitle = "My Page title";
include("template1.html");
?>
Then inside template1.html use the defined PHP variable in this way:
echo "<title> $PageTitle </title>;
Should this work?
Regards,
JohnD
Of the answers provided by Jacer12 below (thanks!) #2 worked and #1 did not. Not sure what the issue is with #1. Also, It seems I cannot rate the answer or select best answer since I am level1.