PHP sayfalama üzerinde çalışıyorum
- I need it to work on any folder so root/ root/folder1/ root/folder1/folder2/ would all work
- It should pass the page number variable for the script to work in the URL but also retain any other variables in the URL that may be present with any amount of variables passed in tthe URL
İşte ben bugüne kadar varlık dayalı bağlantı için ne var @
http://domain.com/test/paging/index.php?var=cool&var2=coo2l&page=1
$selfurl = "http://".$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF'])."";
Bu, yaratacak: http://domain.com/test/paging/ strong>
$qry_str = $_SERVER['argv'][0];
This would create this: var=cool&var2=coo2l&page=1
So far so good, it works no matter how deep the directory system is and passes ANY and ALL variables that may exist in the pages URL (NOTE; I know it assumes it is always the index file I will fix that later)
Bu yüzden aşağıda bu bağlantıların hepsi benim çağrı linkler geçti alacağı;
http://domain.com/test/paging/?page=1
http://domain.com/test/paging/?var=coo2l&page=1
http://domain.com/test/paging/?var=cool&var2=coo2l&page=1
Here is the problem, below is an
example of my NEXT and PREVIOUS link, it works
but the problem is after I go to the
first page, it will keep adding&page=THE-NUMBER-HERE böylece sayfa 3 olsun zaman
gibi olurdu
&page=THE-NUMBER-HERE&page=THE-NUMBER-HERE&page=THE-NUMBER-HERE
yerine
&page=THE-NUMBER-HERE
The links;
<a href="<?PHP echo $selfurl;?>/?<?PHP echo $qry_str;?>&page=<?PHP echo $start-$pagesize;?>" class="bluelinkbold">Next</a>
<a href="<?PHP echo $selfurl;?>/?<?PHP echo $qry_str;?>&page=<?PHP echo $start-$pagesize;?>" class="bluelinkbold" >Previous</a>