PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
That gives me one value with the contents of the file, which are a bunch of numbers seperated by commas (1, 2, 4, 5....). Is there a way to get those numbers to go into seperate values. The real purpose of this is to have the text file be a list of picture numbers, which will be taken and placed on the page. I could download a free picture gallery, but I really would like to make my own.
ok I've made some progress but I am stuck again. I am able to get the pictures to be displayed in the correct order and the links work to open the larger picture. The only thing is I would like to make next/previous links in the pop up. This is what I have so far (the file_v2 is a function on the file() link you replied with). Is there some way to get the values of the previous and next in the foreach operator? I tried to use the previous() and next() functions but couldn't make it work.
<?php
$previous = $_GET['key'] -1;
$next = $_GET['key']+1;
$filepath = "gallery/".$view.".txt";
$open = file_v2($filepath, 0);
//Then you would build a link something like this
echo "<a href="indview.php?id=$previous&file=$open[$previous]" target="indview">
<img src="thumb/$pic.jpg"></a>";
//For the "next" link you would replace $previous with $next
?>
The file is already in an indexed array. When the person clicks on the link to open the window you have the current array index stored in the query string id variable. So retrieve it and subtract one or add one.