php inside js
On this page https://clients.motley.site/dat/archives/purchases I have pagination but need to adjust the pagination link to get the URL (as its a mod rewritten page) and think that in this code
$elems = "<span class=\"paginationLinkActive\">".($i+1)."</span>";
$elems = "<a href=\"archive.php?pageNum_News=$i\" class=\"link-text paginationLink\">".($i+1)."</a>";
I need to change archive.php with <?php echo($_SERVER['REQUEST_URI']); ?> or <?php echo($_SERVER['PHP_SELF']); ?>?
Also, how would I get the pagination > and >> to use the mod rewritten page rather than the actual page?