Bonjour, j'ai un script PHO qui teste la page active est affiche un lien différent si la page active est celle tester ou nom:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
<?php 
// obtenir le nom complet de la page active
$page_active = $_SERVER["PHP_SELF"];
// et la condition :
if (strpos($page_active,'index_2.php')) { 
?>
	<div style="width:150px; height:35px;float:left;" onclick="location.href='#portofolio'" class="DIVarondiOmbreExterne"><a href="#portofolio" class="a1">Portofolio</a></div>
<?php } else { ?>
	<div style="width:150px; height:35px;float:left;" onclick="location.href='#portofolio'"  onmouseover="this.className='DIVarondiOmbreInterne'" onmouseout="this.className=''"  class="divarondi__">
	  <a href="#portofolio" class="a1"> Portofolio</a></div>
<?php } ?>
Mais je voudrais aussi tester l'ancre nomé:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
<?php 
// obtenir le nom complet de la page active
$page_active = $_SERVER["PHP_SELF"];
// et la condition :
if (strpos($page_active,'index_2.php#portofolio')) { 
?>
	<div style="width:150px; height:35px;float:left;" onclick="location.href='#portofolio'" class="DIVarondiOmbreExterne"><a href="#portofolio" class="a1">Portofolio</a></div>
<?php } else { ?>
	<div style="width:150px; height:35px;float:left;" onclick="location.href='#portofolio'"  onmouseover="this.className='DIVarondiOmbreInterne'" onmouseout="this.className=''"  class="divarondi__">
	  <a href="#portofolio" class="a1"> Portofolio</a></div>
<?php } ?>

Maiscomme cela ça ne fonctionne pas, quelqu'un pourrait-il m'aider ?