Hi

I have a artist website to do. I want to have thumnails that when click open larger popup.

If anyone knows of any php code that has been used for this I would love to look at it..

this site is a good example of what I am trying to do..

http://www.hermansmith.nl/thema_roosje.php

Cheers Peter..

    Thing to keep in mind. If it involves doing something when you click the mouse, or opening a window, or anything dynamic on the client, then it's Javascript.

    Really, I think it should be tattooed onto every newbie PHP programmer's forearm: PHP Runs On The Server. Not On The Client.

      I know that.. But it looked like the Onclick had some php in it..

      http://www.hermansmith.nl/large.php?img=./images/roosje/boomstam_g.jpg

      That echoed onto the popup.. Meaning the popup is controled by the onclick. I dont know too much about php though. But I really want to learn

      I am designing an application that is like Frontpage but will do just one site very very quickly. It would save me lots of trouble if I could use php to create the popups with infomation they get from the onclick of the page that has the thumnails of the pic.

      I do appreciate any asistance.

      thx..

        Possum,

        The reason the OnClick function in JavaScript links to a php file instead of directly to an image file is usually done for one of two reasons.

        1. You need to show more than just an image. This could be anything from a background color, navigation, info, whatever. In the case of the site you showed as an example, it looks like it was just for the black background and the title of the image, because there was nothing else on the page.

        2. You need to do some kind of processing before showing the image. This could be anything from checking if the user has the right to see the file, logging the number of times a link is clicked, modifying the image, etc.

        A php file is usually associated with outputting html, but you can also use a php script to load an image, do some processing to the image, and then output it as if it were just an image file (jpg, bmp, gif, png...etc). For example...let's say the images that are stored on the hard drive of the server are too big to display in a browser. I can link to a url like image.php?id=3456&max_width=600. The code in image.php could grab an image off the hard drive by finding it's path and filename in a database (using the id in the url), and then size it down based on the max_width variable I pass to the url, and then output it as just a plain old image.

        There are many reasons you would link to a php file to display an image instead of linking directly to the image file. So, Weedpacket was right that the onClick part of it is done on the client, but as you'll find in most web development, the solution is quite often to use both client and server code.

          wow.. thx everyone...hope I didn't seem to silly.. I am trying... 🙂

            Write a Reply...