|
|
|
|
для: seregarulez
(06.12.2006 в 10:11)
|
|
<?php
$mas = array("q","w","e","r","t","y","u","i","o","p","a","s","d","f","g","h","j","k","l","z","x","c","v","b","n","m");
$pos=count($mas)-1;
if (isset($_GET['position']))
{
if (preg_match("|^[0-9]+$|",$_GET['position']))
{
if ( $_GET['position']<0 or count($mas)<$_GET['position'] )
{
$pos=count($mas)-1;
}
else
{
$pos=$_GET['position'];
if ($pos==0)
{
$pos=4;
}
}
}
}
echo " <table>
<tr>";
if ( ($pos>=5))
{
echo "
<td>
<a href=\"2.php?position=".($pos-5)."\">ПРЕДЫДУЩИЕ</a>
</td>
";
}
if ( ($pos<count($mas)-1 ) )
{
echo "
<td>
<a href=\"2.php?position=".($pos+5)."\">СЛЕДУЮЩИЕ</a>
</td>
";
}
echo "
</tr>
</table>";
echo " <table>
";
for ($i=$pos-4; $i<=$pos; $i=$i+1)
{
echo "
<tr>
<td>
".$mas[$i]."</a>
</td>
</tr>";
}
echo "
</table>";
?>
|
| |
|
|