Created
December 20, 2017 03:39
-
-
Save muhfaris/d606d81042fa9ac55c78890f33b5f111 to your computer and use it in GitHub Desktop.
get link, order table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(isset($_GET['sort'])) { | |
$query = $_GET; | |
if($_GET['sort']=='ASC') { | |
$query['sort'] = 'DESC'; | |
} else { | |
$query['sort'] = 'ASC'; | |
} | |
$query_result = http_build_query($query); | |
$links=$_SERVER['PHP_SELF'].'?'.$query_result; | |
}else{ | |
$links=$_SERVER[REQUEST_URI].'&sort=ASC'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment