# PHP novice having problems with a super simple image swap thingie

**URL:** https://forum.kirupa.com/t/php-novice-having-problems-with-a-super-simple-image-swap-thingie/248941
**Category:** programming
**Created:** [January 13, 2008, 8:34pm UTC](https://forum.kirupa.com/t/php-novice-having-problems-with-a-super-simple-image-swap-thingie/248941 "2008-01-13T20:34:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![khimaira](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@khimaira](https://forum.kirupa.com/u/khimaira)
#### Post date: [January 13, 2008, 8:34pm UTC](https://forum.kirupa.com/t/php-novice-having-problems-with-a-super-simple-image-swap-thingie/248941/1 "2008-01-13T20:34:16Z")

</div>

Hi, and sorry to trouble you with something this simple. ;(

I’m doing a design portfolio with lots of images.

The basic layout is: large image on the left side, thumbnails for other views on the right side.

How can I make a dynamic page that updates the large image when you click on thumbnails?

What I’ve done so far is:

```php
<?php
switch ($id) {
case "client1_01":
$client_img = "img_client1_01.jpg";
break;
case "client1_02":
$client_img = "img_client1_02.jpg";
break;
default:
$client_img = "img_client1_01.jpg";
}
?>

```

HTML code that shows the large image:

```auto
<img src="images/<?php echo $client_img ?>" alt=""/>

```

HTML link syntax to update the large image:

```auto
<a href="?id=client1_01"><img src="images/img_marker_90x70.gif"/></a>

```

These are all in one file, index.php.

It appears that when I click on a link and the url refreshes with the new var content (eg index.php?id=client1\_01) it always runs the default case. Why is that?

Thank you so much,  
mika
