Hi,
I have created an array, using the foreach() function. All well, the script lists a table for each item in the array. Unfortunately, I'd only like 4 items from the array displayed per page, using $_GET, so when going to URL: will display items 5-8 from the array.
Below the code I currently use:
Has anyone an idea for a good approach to achieve what I need?
Thanks!
I have created an array, using the foreach() function. All well, the script lists a table for each item in the array. Unfortunately, I'd only like 4 items from the array displayed per page, using $_GET, so when going to URL: will display items 5-8 from the array.
Below the code I currently use:
Code:
<?
$img_names = array (
'102_1967',
'102_1968',
'102_1969',
'102_1970',
'102_1971',
'102_1972',
'102_1973',
'102_1974',
'102_1975',
'102_1976',
'102_1977',
'102_1978',
'102_1979',
'102_1980',
'102_1981',
'102_1982',
'102_1983',
'102_1984',
'102_1985',
'102_1986',
'102_1987',
'102_1988',
'102_1989',
'102_1990',
'102_1991',
'102_1992',
'102_1993',
'102_1994',
'102_1995',
'102_1996',
'102_1997',
'102_1998',
'102_1999',
'102_2000',
'102_2001',
'102_2002',
'102_2003',
'102_2004',
'102_2005',
'102_2006',
'102_2007',
'102_2008',
'102_2009',
'102_2010',
'102_2011',
'102_2012',
'102_2013',
'102_2014',
'102_2015',
'102_2016',
'102_2017',
'102_2018',
'102_2019',
);
foreach($img_names as $img_name) {
echo "<table width='390' border='0' cellpadding='0' cellspacing='0'>";
echo "<tr>";
echo "<td width='20' valign='top'><input type='checkbox' name='checkbox3' value='checkbox'></td>";
echo "<td width='120' valign='top' class='border'><a href='main.php?img_id=$img_name' target='_parent' name='$img_name'>";
echo "<img src='img/" . $img_name . "_pvw.gif' width='118' height='89'></a></td>";
echo "<td width='10'> </td>";
echo "<td valign='top' class='img_description'><span class='style2'>Datum toegevoegd: $img_date<br>";
echo "Locatie: $img_city, $img_country</span></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='20'> </td>";
echo "<td width='120'> </td>";
echo "<td width='10'> </td>";
echo "<td> </td>";
echo "</tr>";
echo "</table>";
}
?>
Has anyone an idea for a good approach to achieve what I need?
Thanks!