次へ前へのページング

<?php

$page = empty($_GET&#91;"page"&#93;)? 1:$_GET&#91;"page"&#93;;
function paging($page,$disp=5){
    $limit = 10;
	$page = empty($_GET&#91;"page"&#93;)? 1: $_GET&#91;"page"&#93;;

	$next = $page+1;
	$prev = $page-1;

	if($page != 1){
		echo '<a href="?page='.$prev.'">&laquo; 前へ</a>';
	}
	if($page < $limit){
		echo ' <a href="?page='.$next.'">次へ &raquo;</a>';
	}

	// print "current:".$page."<br>";
 //    print "next:".$next."<br>";
 //    print "prev:".$prev."<br>";
}

echo paging();

?>