Okay so as the title says i have a php file with some jquery script inside which help me to "paginate" and show some data from db (usinh php/mysql).
Now i want to edit the way the page numbers are shown (right now they are e.g. 1 2 3 4 5 6 7 8 10 11 12 13 14.... as many reults u can get from db)
so i want to change it like this when u click on page 10 it should remove the rest and add next pages 11 12 13 14 15 16 17 18 19 20 ,again when u click 20 next 10 ... and so on...
The thing is that i need to find out what page i am currently in ,which is a value inside of the script (jquery)
//Loading Data
		var pageNum = this.id;
		jQuery(\"#content\").load(\"pagination_data.php?page=\" + pageNum + \"&searchterm=".$convertedword."\", Hide_Load());
and the php show pages part
$per_page= 6;

		$rsd = $sql;
		$count = mysql_num_rows($rsd);
		$pages = ceil($count/$per_page);

.........................some other code..............

if ($numResults > 0) {
				echo "<div id='loading' ></div>	<div id='content' ></div>
					<ul id='pagination'>
					//Show page links
				for($i=1; $i<=$pages; $i++)
					echo "<li id='".$i."'>".$i."</li>";
					echo "</ul>";
			else {
					echo "<div id='noresults'>No results</div>";

now i need this pageNum (value) to be transferred into $currentpage (php variable) so i can get the page that i am currently and when i will try to do the 10/20/30 instead of all at same time!
You know all i wanna do is to simplify and restrain from having too many pages at same row!
Any help will be appreciated!