I use require_once() to display pages in a div.
I wonder how I could use this to display images as well.
Here is my code :
require_once 'gauche_1.php';
if ( (isset($_GET['page'])) && (isset($checkPage[$_GET['page']])) ) {
require_once $checkPage[$_GET['page']];
}
elseif ( (isset($_GET['category'])) && (isset($checkCategory[$_GET['category']])) ) {
readfile($checkCategory[$_GET['category']]);
} /* if $page has a value, include it */
else {
require_once 'milieu_1.php';
echo '<script type="text/javascript" src="../js/music.js"></script>';
}
my include.php :
$checkPage = array('Sommaire' => 'milieu_1.php',
'Nouveautes' => 'news/index.php' ...,
'Permis_D_Avoir_Du_Culot' => 'image.jpg');
Abd the html code :
<div class="licenseGallery">
<a href="menu.php?category=Permis_D_Avoir_Du_Culot">
<img src="sweeties/permis/tn_permis_avoir_du_culot.jpg" alt="permis_avoir_du_culot.jpg">
<div class="licenseDescription">
permis_avoir_du_culot.jpg
</div>
</a>
</div>