Hi guys,
I need to link 9 thumbs called: project1.jpg, project2.jpg, project3.jpg... to php pages with the same name: project1.php, project2.php, project3.php.
It's my code so far:
<?php
$dir = 'portfolio/print/img/thumbs/';
$main_page ='portfolio/print/project1'; // How can I make $main_page to show the right project each time?
$scan = scandir($dir);
for ($i = 0; $i<count($scan); $i++) {
if ($scan[$i] != '.' && $scan[$i] != '..') {
if (strpos($scan[$i], '.png') !== false) {
$curr = substr($images[$i], 0, strlen($images[$i]) -4) . ".php";
echo '<li>
<a href="'. *** $main_page *** . $curr . '">
<img src="' . $dir . $scan[$i] . '" alt="' . $scan[$i] . '" />
<strong>'. $scan[$i] .'</strong>
</a>
</li>';
}
}
};
?>
* Do I need to create loop to find out the right link to each page? I am not really sure how to do it.
Thank you!!