page= 두번 나오지 않도록 해결
This commit is contained in:
@ -260,11 +260,11 @@ while ($entry = $tmp->read()) {
|
||||
}
|
||||
@ksort($amenu);
|
||||
|
||||
$qstr = '';
|
||||
if (isset($sst)) $qstr .= '&sst='.$sst;
|
||||
if (isset($sod)) $qstr .= '&sod='.$sod;
|
||||
if (isset($sfl)) $qstr .= '&sfl='.$sfl;
|
||||
if (isset($stx)) $qstr .= '&stx='.$stx;
|
||||
if (isset($page)) $qstr .= '&page='.$page;
|
||||
//$qstr = 'sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&page=$page';
|
||||
$arr_query = array();
|
||||
if (isset($sst)) $arr_query[] = 'sst='.$sst;
|
||||
if (isset($sod)) $arr_query[] = 'sod='.$sod;
|
||||
if (isset($sfl)) $arr_query[] = 'sfl='.$sfl;
|
||||
if (isset($stx)) $arr_query[] = 'stx='.$stx;
|
||||
if (isset($page)) $arr_query[] = 'page='.$page;
|
||||
$qstr = implode("&", $arr_query);
|
||||
?>
|
||||
@ -18,7 +18,7 @@ function get_microtime()
|
||||
// 현재페이지, 총페이지수, 한페이지에 보여줄 행, URL
|
||||
function get_paging($write_pages, $cur_page, $total_page, $url, $add="")
|
||||
{
|
||||
$url = preg_replace('#(&|&)?page\=[0-9]+#', '', $url);
|
||||
$url = preg_replace('#&page=[0-9]*(&page=)$#', '$1', $url);
|
||||
|
||||
$str = '';
|
||||
if ($cur_page > 1) {
|
||||
@ -748,7 +748,15 @@ function subject_sort_link($col, $query_string='', $flag='asc')
|
||||
}
|
||||
}
|
||||
|
||||
return '<a href="'.$_SERVER['PHP_SELF'].'?'.$query_string.'&'.$q1.'&'.$q2.'&sfl='.$sfl.'&stx='.$stx.'&page='.$page.'">';
|
||||
$arr_query = array();
|
||||
$arr_query[] = $q1;
|
||||
$arr_query[] = $q2;
|
||||
$arr_query[] = 'sfl='.$sfl;
|
||||
$arr_query[] = 'stx='.$stx;
|
||||
$arr_query[] = 'page='.$page;
|
||||
$qstr = implode("&", $arr_query);
|
||||
|
||||
return "<a href=\"{$_SERVER['PHP_SELF']}?{$qstr}\">";
|
||||
}
|
||||
|
||||
|
||||
|
||||
30
test.php
30
test.php
@ -1,24 +1,8 @@
|
||||
<!doctype html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<title>title</title>
|
||||
<meta charset="utf-8">
|
||||
<script src="js/jquery-1.8.3.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<?
|
||||
$qstr1 = "&stx=ddd&page=123";
|
||||
$qstr2 = "&stx=ddd&page=123&";
|
||||
$qstr3 = "&stx=ddd&page=&";
|
||||
$qstr3 = "&stx=ddd&page=x&";
|
||||
|
||||
<p>이 문자열에서 부분을 치환합니다.</p>
|
||||
|
||||
<a href="#" title="치환">치환하기</a>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$('a').click(function(){
|
||||
$('p').text("치환");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
echo preg_replace('#(&|&)?page\=[^&]*#', '', $qstr3);
|
||||
?>
|
||||
Reference in New Issue
Block a user