Hello.
I'm going to show you how to make a basic php image gallery.
Firstly, create the following files
- index.php
- view.php
- /images (dir)
Now, for the code.
index.php
<?php
$img = array();
$img[] = array('title'=>'img1', 'src' = 'img1.jpg');
?>
<html>
<head>
<title>mygallery | homepage</title>
</head>
<body>
<h2>mygallery</h2>
<?php
for($i = 0;$i <= count($img);$i++;) {
echo '<div class="slide">';
echo '<a href="slide.php?id='.$img[$i]['src'].'&title='.$img[$i]['title'].'" target="_blank">';
echo '<span style="font-size:15pt">'.$img[$i]['title'].'</span><img src="images/'.$img[$i]['src'].'" width="100" height="100" />';
echo '</a>';
echo '</div>';
}
?>
</body>
</html>
slide.php
<html>
<head>
<title>mygallery : viewing <?php echo $_GET['title']; ?></title>
</head>
<body>
<h2><?php echo $_GET['title']; ?></h2>
<img src="images/<?php echo $_GET['src']; ?>" />
</body>
</html>