본문 바로가기

반응형

Story/php

php setcookie 쿠키 모바일 mobile 에서 종료시간 php 에서 쿠키를 사용하기 위해 setcookie 함수를 사용한다. bool setcookie ( string $name [, string $value [, int $expire = 0 [, string $path [, string $domain [, bool $secure = false [, bool $httponly = false ]]]]]] ) setcookie() defines a cookie to be sent along with the rest 보통 setcookie("쿠키이름","쿠키값"); 이런식으로 expire 부분을 안쓰면 기본 0 값이 적용되어서 브라우져를 닫으면 쿠키가 사라진다. 그런대 당연히 되리라 생각했던 이 방법이 모바일에선 쿠키가 원하는 시점에 사라지지 않았다. php 사이.. 더보기
php iframe check 호출되는 페이지가 아이프레임인지 아닌지 확인할 방법이 필요한대 javascript 로는 확인이 가능한대 php 로는 어떻게 해야 하는지 궁리해보니 $_SERVER['HTTP_REFERER'] 이 값을 이용하면 된다. iframe 으로 불려질때 $_SERVER['HTTP_REFERER'] 값이 parent 창에 주소값을 가진다. 이 값이 있다고 iframe 인건 아니지만 $_SERVER['HTTP_REFERER'] 값이 없다면 iframe 이 아닌것은 확인이 된다. 아이프레임으로 호출된게 아니라면 처리하게끔 할때 if($_SERVER['HTTP_REFERER']==""){ // HTTP_REFERER 값이 없다면 직접 주소창에서 접근한것이다. (iframe 아님) header('Location: /pare.. 더보기
metaWeblog 를 이용하여 블로그(blog)에 글을 등록해보자 MetaWeblog API 란 The MetaWeblog API is an application programming interface created by software developer Dave Winer that enables weblog entries to be written, edited, and deleted using web services. The API is implemented as an XML-RPC web service with three methods whose names describe their function: metaweblog.newPost(), metaweblog.getPost() and metaweblog.editPost(). These methods take argu.. 더보기
KCP 모바일 결제모듈 스마트결제 [ 거래인증을 위한 APM 환경설정 ] ※ APM 버전은 5.0 이상으로 연동 (PHP 5.0 이하는 soap 지원 하지 않음) 5.0 이하 버전으로 연동시 approval_key.js JavaScript 오류가 발생합니다.(스마트폰 연동시) [ 거래인증 통신을 하기 위한 서버 설정 ] ※ Windows_php 의 경우 php_openssl.dll 과 php_soap.dll 설정 Linux_php 의 경우 서버에 configure openssl 과 --enable-soap 설정 ※ 거래인증등록 통신 방법은 SOAP 통신 기술을 기반으로 제공합니다. 모듈 : 메뉴얼 : . . . . . - 계좌이체의 경우 pay_method 값이 메뉴얼이랑 sample 페이지 가 서로 다릅니다. 테스트해본결과 sample.. 더보기
php date_format smarty smarty_modifier_date_format is_numeric 64bit 날짜 문제 php smarty 를 32비트 운영체계에서 사용하다가 64비트로 os를 업그래이드 한후 "20130812174109" 값을 {#$BoardConts.reg_dm|date_format:"%Y.%m.%d"#} 이런식으로 출력했을때 3000년이 넘게 나오는등 이상이 생겼다. 구글링을 통해서 찾아보니 http://www.smarty.net/forums/viewtopic.php?p=8837 에서 By debugging smarty_make_timestamp() function, it turns out that strtotime() of this value is returning something that is_numeric() so it is returned. That means the special mysql.. 더보기
PHP 5.3 이상에서 Deprecated 에러 발생시 처리 PHP Deprecated: Function [함수명] is deprecated 해당 에러 문구는 PHP 6.0부터는 해당 함수들이 제거될 예정이니 개발시 더 이상 사용하지 말 것을 권고하는 메시지입니다. 경고 메시지이므로 사용상에 문제는 없으며, php.ini 파일을 수정하여 해당 문구가 발생하지 않도록 설정할 수 있습니다. # vi php.ini 519 ; Production Value: E_ALL & ~E_DEPRECATED 520 ; http://php.net/error-reporting 521 error_reporting = E_ALL & ~E_NOTICE 521번째 줄의 error_reporting = E_ALL & ~E_NOTICE 항목을 error_reporting = "E_ALL & ~E.. 더보기
php 구글맵 api 로 주소 좌표로 변환 $xml = simplexml_load_file('http://maps.googleapis.com/maps/api/geocode/xml?address='.urlencode("찾을주소").'&sensor=false'); $xml->result->geometry->location->lat; $xml->result->geometry->location->lng 더보기
뱅크다 이용 무통장입금 처리 뱅크다 이용 무통장입금 처리 뱅크다 참조 $agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)'; $cookie_nm = './cookie.txt'; $url = "https://www.bankda.com/dtsvc/xmldown.php"; $param = "xml_userid=" . $xml_userid . "&xml_pwd=" . $xml_pwd . "&xml_acctno=" . $xml_acctno . "&xml_date=" . $xml_date . "&xml_bkcode=" . $xml_bkcode; $result = array(); $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL,$url); //접속할.. 더보기
window 에서 php fgetcsv 사용시 한글문제 윈도우에 php 설치해서 fgetcsv 함수로 cvs 읽어드릴때 한글이 깨질때가 있는대 setlocale(LC_CTYPE, "ko_KR.eucKR"); 을 추가해서 작업하면 해결된다. 더보기
디바이스별 viewport 설정 디바이스별 viewport 설정. 더보기

반응형