추천인아이디를 서브도메인으로 하고, 레벨3 이상일 때만 주소 유지하기 채택완료
zona
10년 전
조회 3,619
안녕하세요
레벨3 이상만 추천인 활동을 하도록 했습니다 http://sir.co.kr/qa/83789#answer_88608">http://sir.co.kr/qa/83789#answer_88608
그래서 현재
http://추천인아이디.test.com 하고 접속하면 추천인이 자동으로 입력됩니다.
그런데,
111.test.com
222.test.com
333.test.com 등등등
"추천인아이디" 자리에 아무거나 써도 다 그걸 추천인으로 인식하더군요.
그래서 "추천인아이디"가 레벨 3 이 안되면
그냥 http://test.com/">http://test.com 으로 접속이 되도록 돌리고 싶어요
그래서 index.php 파일에 코드를 짜 봤는데
극초보 실력이라서...당연히 안되더라구요..
고수님들의 도움을 부탁드립니다. (_ _)
</SPAN></DIV>
<DIV><SPAN>#추천인 회원레벨 3미만일때 도메인 자동이동</SPAN></DIV>
<DIV><SPAN>$domain_arr = explode('.',$_SERVER[HTTP_HOST])
$dom_id="select count(*) from g5_member where mb_id='".$mb_id."' and mb_level < '3'";
if ($domain_arr[0] < $dom_id){
$redirect= “<a href="http://test.com" target="_blank" rel="noopener noreferrer">http://test.com</a>";
}</SPAN></DIV>
<DIV><SPAN>
도메인의 첫글자(추천인)를 구하고, 회원레벨과 비교해서 3보다 작으면
주소를 http://test.com/">http://test.com 으로 이동한다...라고 하고 싶은뎅... ㅠ
댓글을 작성하려면 로그인이 필요합니다.
답변 3개
채택된 답변
+20 포인트
10년 전
새답변입니다. 이걸로 하세요.
#추천인 회원레벨 3미만일때 도메인 자동이동 $domain_arr = explode('.',$_SERVER[HTTP_HOST]) $dom = sql_fetch("select count(*) as cnt from g5_member where mb_id='".$domain_arr[0]."' and mb_level < 3 "); if ($dom['cnt'] > 0){ $redirect= “<a href="http://test.com" target="_blank" rel="noopener noreferrer">http://test.com</a>"; }
로그인 후 평가할 수 있습니다
답변에 대한 댓글 7개
z
zona
10년 전
죄송합니다.. 안되네요.. ㅠ 한 번만 더 체크해 주시면 안될까요? (_ _)
�
카츠
10년 전
if문 위에 echo $dom['cnt']; 하셔서 뿌려지는 값을 체크해보세요.
추천인회원레벨 3미만인 회원의 아이디.test.com 으로 접속하시구요.
추천인회원레벨 3미만인 회원의 아이디.test.com 으로 접속하시구요.
z
zona
10년 전
...제가 아미나 테마를 써서 안되는걸까요? 이 코드를 쓰면 사이트 자체가 먹통이 되어 버려요...ㅠ
아무튼 친절한 답변 너무너무 감사합니다...꾸벅~
아무튼 친절한 답변 너무너무 감사합니다...꾸벅~
�
카츠
10년 전
아미나테마하고는 관계가 없을텐데요. 아미나 테마와 관련있는 코드가 사용된것도 아니구요. $redirect 변수에 할당된 http://test.com 으로 실제 리다이렉션은 걸어주셨나요?
어떻게 적용하셨는지 다른 장애가 생기는 코드가 있는지 유무를 모르니 저도 더이상답변은 어렵네요.
어떻게 적용하셨는지 다른 장애가 생기는 코드가 있는지 유무를 모르니 저도 더이상답변은 어렵네요.
z
zona
10년 전
$redirect 변수 대신
5째줄을
echo header("Location:http://test.com");
이렇게 하니까 되네요. 친절한 안내에 ^^ 감사합니다. 행복한밤 되세요 ^^
5째줄을
echo header("Location:http://test.com");
이렇게 하니까 되네요. 친절한 안내에 ^^ 감사합니다. 행복한밤 되세요 ^^
�
카츠
10년 전
머라 드릴말씀이 없군요. ㅡㅡ;
z
zona
10년 전
죄송한데 하나 더 해결 못 한 게 있어서요....
추천회원아이디를 http://아무거나.test.com 써도 아무거나로 다 인식되는데, 아무거나 쓸 경우 “http://test.com"으로 연결되게 하려면 어떻게 해야 할까요...^^;
추천회원아이디를 http://아무거나.test.com 써도 아무거나로 다 인식되는데, 아무거나 쓸 경우 “http://test.com"으로 연결되게 하려면 어떻게 해야 할까요...^^;
댓글을 작성하려면 로그인이 필요합니다.
10년 전
아래의 모든 경우의 수를 다 해봤는데도 안되네요.. ㅠㅠ
고수님들의 조언을 다시 한 번 부탁드립니다...(_ _)
</P>
<P>$domain_arr = explode('.',$_SERVER[HTTP_HOST]);
$dom_id = "select count(*) from g5_member where mb_id='".$mb_id."' and mb_level >= '3'";
if (!$domain_arr[0] == $dom_id){
//<1> $redirect = “<A href="<a href="http://test.com/" target="_blank" rel="noopener noreferrer">http://test.com/</a>"><a href="http://test.com" target="_blank" rel="noopener noreferrer">http://test.com</a></A>";
//<2> redirect('test.com');
//<3> echo "<meta http-equiv='refresh' content='0;url=test.com'>";
//<4> echo header("Location:<A href="<a href="http://test.com/" target="_blank" rel="noopener noreferrer">http://test.com/</a>"><a href="http://test.com" target="_blank" rel="noopener noreferrer">http://test.com</a></A>");
//<5> header("Location: <A href="<a href="http://onil.kr/" target="_blank" rel="noopener noreferrer">http://onil.kr/</a>">http://<FONT color=#000000>test.com</FONT></A>");
// exit();</P>
<P> <6> $redirect('<A href="<a href="http://test.com/" target="_blank" rel="noopener noreferrer">http://test.com/</a>"><a href="http://test.com" target="_blank" rel="noopener noreferrer">http://test.com</a></A>');
}</P>
<P>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
10년 전
코드를 아래와 같이 바꾸세요.#추천인 회원레벨 3미만일때 도메인 자동이동 $domain_arr = explode('.',$_SERVER[HTTP_HOST]) $dom_cnt = "select count(*) from g5_member where mb_id='".$domain_arr[0]."' and mb_level < '3'"; if ($dom_cnt > 0){ $redirect= “<a href="http://test.com" target="_blank" rel="noopener noreferrer">http://test.com</a>"; }
로그인 후 평가할 수 있습니다
답변에 대한 댓글 2개
z
zona
10년 전
안되네요..그래서 디테일하게 놓친 거 있나 보고
2줄에 ;추가, 5줄에 띄어쓰기 수정해 봤으나 그래도 안되네요..ㅠㅠ
엉엉..
[code]
#
$domain_arr = explode('.',$_SERVER[HTTP_HOST]);
$dom_cnt = "select count(*) from g5_member where mb_id = '".$domain_arr[0]."' and mb_level < '3'";
if ($dom_cnt > 0){
$redirect = “http://test.com";
}
[/code]
2줄에 ;추가, 5줄에 띄어쓰기 수정해 봤으나 그래도 안되네요..ㅠㅠ
엉엉..
[code]
#
$domain_arr = explode('.',$_SERVER[HTTP_HOST]);
$dom_cnt = "select count(*) from g5_member where mb_id = '".$domain_arr[0]."' and mb_level < '3'";
if ($dom_cnt > 0){
$redirect = “http://test.com";
}
[/code]
�
카츠
10년 전
헐.. 멀 답변드린 걸까요? 대충보고 빠르게 다느라 아무생각없이 답변드렸나보네요. 쿼리자체를 날리질 않았으니 무슨 처리가 될까요?
다시 답변달아둘께요.
다시 답변달아둘께요.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인