"Michael Crane" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hello,
> I have a webpage which includes a frame containing a table made of 24
> tds which in turn contain little images. When the mouse clicks on a
> little image the appropriate larger image is loaded into an adjacent
frame.
> Can somebody point me in the direction to do this in php without frames
> please ?
>
> I've been looking most of the day but I can't see it.
>
> regards
>
> mick

Hi Mick,

you have to append the file name of the bigger version to your links as a
parameter:

<a href="<?php= $_SERVER['PHP_SELF']; ?>?image=name_of_the_big_file1">big
picture 1</a>
<a href="<?php= $_SERVER['PHP_SELF']; ?>?image=name_of_the_big_file2">big
picture 2</a>
<a href="<?php= $_SERVER['PHP_SELF']; ?>?image=name_of_the_big_file3">big
picture 3</a>

Exchange name_of_the_big_file1/2/3 with the file names of the big image
versions. Then at the point where you want to show the big image include
this code:

<?php
if (isset($_GET['image'])) {

    $image = basename($_GET['image']);
    echo '<img src="' . $image . '" border="0" alt="">';
}
?>

Of course you may have to alter the src attribute if your pictures are not
in the same directory.


Hope this helps, regards.

Torsten Roehr

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to