Hello, I am trying to create a picture gallery.

What's the difference between:

http://www.website.com/picture.php#1 and http://www.website.com/picture.php#2

Are they different pages ? On the side there will be a list of thumbnail, and when I click the thumbnail the large picture appears.

how to code it?

The links above are referring to the named anchors (1, 2...) on the same page (hence #).

The links above are constructed this way if they are on the page picture.php:

<a href="#1">Picture 1</a>
<a href="#2">Picture 2</a>

or if they are on some other page:

<a href="picture.php#1">Picture 1</a>
<a href="picture.php#2">Picture 2</a>

On the page picture.php you have a named anchor at every img tag:

<a name="1"><img href="picture1.jpg"></a>
<a name="2"><img href="picture2.jpg"></a>

Now users are scrolled directly to the chosen picture.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.