Forum Moderators: coopster
<a href="pics.php?pic=image">PIC</a>
-------------------
pics.php - includes this php/html link which creates the dynamic page,
<img src="<? echo $pic ?>.jpg">
resulting in a link which when clicked opens the picture in a dynamic page pics.php, but how can i get it to dispaly a description of the picture to, i thought there was a way of adding a alt tag to thumbnails.htm i.e :
<a href="pics.php?pic=image" alt="blah blah">PIC</a>
then in pics.php looking up the alt tag and dsiaplying it, problem is im a newbie and havent the faintest idea of how to code this? or get it to work so any help is greatfully recieved!
Dan
this is what ive done to over come this problem,
.htm file
<a href="pics.php?pic=apple&desc=apple">PIC</a>
.php file
<img src="<? echo $pic?>.jpg">
<br>
<? echo $desc?>
which works!
what is the best way to learn php?
It is a good habit to use the superglobal to access variables in forms and querystrings because one day you might move to another server which may have auto-globals turned off. Then, you would have to change all of your scripts.
If you plan to have alot of images and descriptions, you may want to think about using a database to store your image descriptions. It has a few benefits, like being able to run searches on all your image descriptions for certain keywords and also categorizing them.
For learning PHP, I like the manual at php.net. Always read the user notes at the bottom too, they can be helpful.
This forum is also a great place to learn.