trimString($_REQUEST['etime']); $reqCode2 = $urlDB->trimString($_REQUEST['userid']); $dirUrl = 'http://www.knn.co.kr/'; if( $reqCode1!='' && $reqCode2!='' ) { $sql = 'SELECT top 1 post_id FROM knnblog_postmeta WHERE meta_key LIKE ? AND meta_value LIKE ?;'; $params = array($reqCode1, $reqCode2); $urlDB->query($sql, $params); $stmtOut = $urlDB->stmt; $result = sqlsrv_fetch_array( $stmtOut, SQLSRV_FETCH_ASSOC); if($result['post_id']){ $dirUrl .= $result['post_id']; } } /* 리다이렉트 */ header("Location: ".$dirUrl); echo ""; //http://www.knn.co.kr/prog/url.php?code1=2014081200003&code2=seona $urlDB->close(); /* End of PHP */