I'm sure that I use a wrong way but it's my first attempt to use php. The next code doesn't work. The variable $file
is defined locally but I don't know how to use a global variable.
articles.php In this file I have a list :
<ol>
<li><a <?php $file="a.php"; ?> href="article.php" > title 1 </a> </li>
<li><a <?php $file="b.php"; ?> href="article.php" > title 2 </a> </li>
</ol>
article.php in this file I want to use this
<?php include("articles/$file"); ?>
How to define correctly $file
?
Is there a better way to load a.php
and b.php
?