I have a php page that contains images as links. I want that when I click the image, I remain on the same page, but get the name of the city that the image contains.
My code:
[CODE]<div class=”den_stema2″>
<a href=”#?link=nisporeni”>
<img src=”Nisporeni/Poze/stemaNisporeni.jpg” />
</a>
</div>
<div class=”den_stema2″>
<a href=”#?link=orleans”>
<img src=”Orleans/Poze/stemaOrleans.jpg” />
</a>
</div>
<div class=”den_stema2″>
<a href=”#?link=szekszard”>
<img src=”Szekszard/Poze/stemaSzekszard.jpg” />
</a>
</div>
<div class=”desc_stema”>
<p><a href=”#?link=nisporeni”>Nisporeni</a></p>
</div>
<div class=”desc_stema”>
<p><a href=”#?link=orleans”>Orleans</a></p>
</div>
<div class=”desc_stema”>
<p><a href=”#?link=szekszard”>Szekszard</a></p>
</div>
Cod: Selectaţi tot
And in the same page:
[CODE] <?php $city = $_GET[‘link’]; //line 353
echo $city;
?>
[QUOTE]
Notice: Undefined index: link in C:UwAmpwwwPrimariaContinut_siteDespre_LugojOrase_infratiteorase_infratite.php on line 353
I tried to declare “$link=”;” before the whole code, but same Notice.
Thank you!