Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
ltman.eemo.co.kr
/
public_html
/
www
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/ltman.eemo.co.kr/public_html/www/join_next_do_21.php
<? session_cache_limiter('no-cache, must-revalidate'); session_start(); header("Pragma: no-cache"); header("Cache-Control: no-cache,must-revalidate"); header("Content-Type: text/html; charset=utf-8"); include_once("dbconn.php"); include_once("lib.php"); foreach($_GET as $key => $value) { ${$key}=mysql_real_escape_string(trim($value)); } foreach($_POST as $key => $value) { ${$key}=mysql_real_escape_string(trim($value)); } $arr_rst=array(); $auth=ucode(); $auth=substr($auth,-4); $auth2=ucode(); $auth2=sprintf("%04d",rand(1,9999)); $code=$auth.$auth2; $saup_num2=str_replace("-","",$saup_num); $saup_num2=str_replace(".","",$saup_num2); $saup_num2=str_replace(" ","",$saup_num2); $saup_num2=str_replace("/","",$saup_num2); $saup_num2=str_replace("*","",$saup_num2); $saup_num2=str_replace("&","",$saup_num2); $saup_num2=str_replace("@","",$saup_num2); $saup_num2=str_replace("~","",$saup_num2); $saup_num2=str_replace("#","",$saup_num2); $rs_saup=RS("select * from ltman_member where REPLACE(saup_num,'-','')='$saup_num2' "); if($rs_saup[no]) { $arr_rst['rst']='saup_double'; echo json_encode($arr_rst); exit; } $query="insert into ltman_member set company_no='{$rs_code[no]}', id='$user_id', name='$user_name', pass='$user_pass', lat='$lat', lon='$lon', sido='$sido', sigungu='$sigungu', tel='$user_cel', email='$email_21', addr='$user_addr', addr2='$user_addr2', mtype='$mtype', mtype2='$mtype2', wetak_codenum='$code', wetak_company_name='$wetak_company_name', saup_num='$saup_num', regdate=now() "; mysql_query($query) or die(mysql_error()); $ino=mysql_insert_id(); /** * 치환 메일 발송 */ /* 예약 API 사용시 여기서부터 삭제후 이용 하시기 바랍니다. */ $ch = curl_init(); /* 여기서부터 수정해주시기 바랍니다. */ $subject = '[인증번호] 위탁대행사 코드번호 발송 '; //필수입력 $body = '위탁대행사 코드번호 : <b>'.$code.'</b><br>감사합니다.'; //필수입력 $sender = "jara2048@hanmail.net"; //필수입력 $sender_name = "(주)양계인"; $username = "mirazi9"; //필수입력 $key = "CfM1zG5JKkaaKo6"; //필수입력 //수신자 정보 추가 - 필수 입력(주소록 미사용시), 치환문자 미사용시 치환문자 데이터를 입력하지 않고 사용할수 있습니다. //치환문자 미사용시 {"email":"aaaa@directsend.co.kr"} 이메일만 입력 해주시기 바랍니다. $receiver = '{"name":"'.$user_name.'", "email":"'.$email_21.'"}' ; $receiver = '['.$receiver.']'; //JSON 데이터 // 주소록을 사용하길 원하실 경우 아래 주석을 해제하신 후, 사이트에 등록한 주소록 번호를 입력해주시기 바랍니다. //$address_books = "0,1,2"; //발송 할 주소록 번호 , 로 구분함 (ex. 0, 1, 2) $bodytag = '1'; //HTML이 기본값 입니다. 메일 내용을 텍스트로 보내실 경우 주석을 해제 해주시기 바랍니다. // 실제 발송성공실패 여부를 받기 원하실 경우 아래 주석을 해제하신 후, 사이트에 등록한 URL 번호를 입력해주시기 바랍니다. $return_url = 0; //open, click 등의 결과를 받기 원하실 경우 아래 주석을 해제하신 후, 사이트에 등록한 URL 번호를 입력해주시기 바랍니다. //등록된 도메인이 http://domain 와 같을 경우, http://domain?type=[click | open | reject]&mail_id=[MailID]&email=[Email] 과 같은 형식으로 request를 보내드립니다. $option_return_url = 0; $open = 1; // open 결과를 받으려면 아래 주석을 해제 해주시기 바랍니다. $click = 1; // click 결과를 받으려면 아래 주석을 해제 해주시기 바랍니다. $check_period = 3; // 트래킹 기간을 지정하며 3 / 7 / 10 / 15 일을 기준으로 지정하여 발송해 주시기 바랍니다. (단, 지정을 하지 않을 경우 결과를 받을 수 없습니다.) // 예약발송 정보 추가 $mail_type = 'NORMAL'; // NORMAL - 즉시발송 / ONETIME - 1회예약 / WEEKLY - 매주정기예약 / MONTHLY - 매월정기예약 $start_reserve_time = date('Y-m-d H:i:s'); // 발송하고자 하는 시간(시,분단위까지만 가능) (동일한 예약 시간으로는 200건 이상 등록할 수 없습니다.) $end_reserve_time = date('Y-m-d H:i:s'); // 발송이 끝나는 시간 1회 예약일 경우 $start_reserve_time = $end_reserve_time // WEEKLY | MONTHLY 일 경우에 시작 시간부터 끝나는 시간까지 발송되는 횟수 Ex) type = WEEKLY, start_reserve_time = '2017-05-17 13:00:00', end_reserve_time = '2017-05-24 13:00:00' 이면 remained_count = 2 로 되어야 합니다. $remained_count = 1; // 예약 수정/취소 API는 소스 하단을 참고 해주시기 바랍니다. //필수안내문구 추가 $agreement_text = '본메일은 [$NOW_DATE] 기준, 회원님의 수신동의 여부를 확인한 결과 회원님께서 수신동의를 하셨기에 발송되었습니다.'; $deny_text = "메일 수신을 원치 않으시면 [" . '$DENY_LINK' . "]를 클릭하세요.\\nIf you don't want this type of information or e-mail, please click the [".'$EN_DENY_LINK'."]"; $sender_info_text = "사업자 등록번호:-- 소재지:ㅇㅇ시(도) ㅇㅇ구(군) ㅇㅇ동 ㅇㅇㅇ번지 TEL:--\\nEmail: <a href='mailto:test@directsend.co.kr'>test@directsend.co.kr</a>"; $logo_state = 1; // logo 사용시 1 / 사용안할 시 0 $logo_path = 'http://logoimage.com/image.png'; //사용하실 로고 이미지를 입력하시기 바랍니다. // 첨부파일의 URL을 보내면 DirectSend에서 파일을 download 받아 발송처리를 진행합니다. 첨부파일은 전체 10MB 이하로 발송을 해야 하며, 파일의 구분자는 '|(shift+\)'로 사용하며 5개까지만 첨부가 가능합니다. $file_url = 'https://directsend.co.kr/test.png|https://directsend.co.kr/test1.png'; // 첨부파일의 이름을 지정할 수 있도록 합니다. // 첨부파일의 이름은 순차적(https://directsend.co.kr/test.png - image.png, https://directsend.co.kr/test1.png - image2.png) 와 같이 적용이 되며, file_name을 지정하지 않은 경우 마지막의 파일의 이름으로 메일에 보여집니다. $file_name = 'image.png|image2.png'; /* 여기까지 수정해주시기 바랍니다. */ $postvars = '"subject":"'.$subject.'"'; $postvars = $postvars.', "body":"'.$body.'"'; $postvars = $postvars.', "sender":"'.$sender.'"'; $postvars = $postvars.', "sender_name":"'.$sender_name.'"'; $postvars = $postvars.', "username":"'.$username.'"'; $postvars = $postvars.', "receiver":'.$receiver; $postvars = $postvars.', "key":"'.$key.'"'; $postvars = '{'.$postvars.'}'; //JSON 데이터 // URL $url = "https://directsend.co.kr/index.php/api_v2/mail_change_word"; //헤더정보 $headers = array( "cache-control: no-cache", "content-type: application/json; charset=utf-8" ); curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_POST, true); curl_setopt($ch,CURLOPT_POSTFIELDS, $postvars); //JSON 데이터 curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT ,3); curl_setopt($ch,CURLOPT_TIMEOUT, 20); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); /* * response의 실패 * {"status":101, "msg":"UTF-8 인코딩이 아닙니다."} * 실패 코드번호, 내용 */ /* * response 성공 * {"status":0} * 성공 코드번호 * * 잘못된 이메일 주소가 포함된 경우 * {"status":0, "msg":"유효하지 않는 이메일을 제외하고 발송 완료 하였습니다.", "msg_detail":"error email : test2@test2, test3@test"} * 성공 코드번호, 내용, 잘못된 데이터 * */ /* status code 0 : 정상발송 100 : POST validation 실패 101 : 회원정보가 일치하지 않음 102 : Subject, Body 정보가 없습니다. 103 : Sender 이메일이 유효하지 않습니다. 104 : receiver 이메일이 유효하지 않습니다. 105 : 본문에 포함되면 안되는 확장자가 있습니다. 106 : body validation 실패 107 : 받는사람이 없습니다. 108 : 예약정보가 유효하지 않습니다. 109 : return_url이 없습니다. 110 : 첨부파일이 없습니다. 111 : 첨부파일의 개수가 5개를 초과합니다. 112 : 파일의 총Size가 10 MB를 넘어갑니다. 113 : 첨부파일이 다운로드 되지 않았습니다. 114 : utf-8 인코딩 에러 발생 200 : 동일 예약시간으로는 200회 이상 발송할 수 없습니다. 201 : 분당 300회 이상 발송할 수 없습니다. 202 : 발송자명이 최대길이를 초과 하였습니다. 205 : 잔액부족 999 : Internal Error. */ //curl 에러 확인 curl_close ($ch); $dec=json_decode($response); if($dec->status=='0') { $arr_rst['rst']='1'; $arr_rst['code']=$code; echo json_encode($arr_rst); } else { mysql_query("delete from ltman_member where no='$ino' ") or die(); $arr_rst['rst']='0'; $arr_rst['code']=$code; echo json_encode($arr_rst); } ?>