For example, I have a page called 'include.php'
or 'include.html'
, which contains the following lines of code:
<h1>Hi {$yourname}, this is a header.</h1>
Now, I want to include this page using PHP on another page, let's say on 'index.php'
using:
<?
$yourname = 'Bir';
include 'include.php';
?>
When I include it, the page shows:
<h1>Hi {$yourname}, this is a header.</h1>
The variable $yourname is not replaced by it's value "Bir"
.
How do I solve this problem?