Forum Moderators: not2easy
i can make a disc.html and apply all the CSS to it, but i have more than 50 images, just wondering if there's an easier way to accomplish it.
asoza
I have no idea I'm afraid, but in case you've not seen it look at the last few msg's in This thread [webmasterworld.com]
Possibly you could adapt it to do something similar on you pages? Good luck!
Nick
Then you make the gallery links look something like this:
<a href="pic_show.php?pic=1">
<a href="pic_show.php?pic=2">
<a href="pic_show.php?pic=3">
And on pic_show.php you would have:
<img src="<? echo $pic ?>.jpg">
You can format pic_show.php any way you want!
however, do you know any good tutorials that will offer the basic about php? i know what php is and how it works. but i have never actually wrote one myself. but thank you for the help. at least i know it is possible :)
asoza
What you want to do is really strait forward, your gallery page does not need to be PHP, only the picture viewing page.
So, as long as your pic links contain the query like above post and your picture viewing page has the extension of .php and contains this code:
<img src="<? echo $pic ?>.jpg">
you are all set.
You can also set the alt dynamicaly by doing the following
<img src="<? echo $pic ?>.jpg" alt="<? echo $alt ?>">
The query would look like this:
<a href="pic_show.php?pic=1&alt=1">
<a href="pic_show.php?pic=2&alt=2">
<a href="pic_show.php?pic=3&alt=3">
dhdweb
if the image is 'disc.jpg'. The numbers probably stem from the fact that it is not uncommon to use a directory full of images with names like '1.jpg', '2.jpg', '3.jpg' and so on. How you name your files is up to you. Do something that makes sense to you.
<added> In addition to the assumption about short tags that has already been mentioned, dhdweb's code assumes that PHPs 'register globals' option is on. This isn't guaranteed, either, but it's easy to deal with if 'register_globals' is off. just add
<?php $pic = $_GET['pic'];?>
or
<?php $pic = $HTTP_GET_VARS['pic']'?>
somewhere earlier in the file than the line dhdweb gave you. The first line is best if it works, because in newer versions of PHP the second line is deprecated, and in future versions it may cease to work at all. On the other hand, older versions of PHP don't support the first line I provided.
</added>