목록개발 경험 Tip/PHP (42)
웹스쿨
$total_time = 86400; //24시간은 86400초$days = floor( $total_time / 86400 );$time = $total_time - ( $days * 86400 );$hours = floor( $time / 3600 );$time = $time - ( $hours * 3600 );$min = floor( $time / 60 );$sec = $time - ( $min * 60 ); $stay_time = "";if($days != 0) $stay_time .= $days."일 ";if($hours != 0) $stay_time .= $hours."시간 ";if($min != 0) $stay_time .= $min."분 ";$stay_time .= $sec."초 "; 이 ..
로그 프로그램을 만들어야 했다.사이트에 접속한 사람이 어떤 페이지를 방문했고, 그 페이지에 얼마의 시간동안 체류했고, 검색키워드는 뭘로 타고왔고, 브라우저는 뭐고 기타등등...뭐 접속정보에 대한 정보는 에이젼트(AGENT)값과 레퍼러(REFERER)값을 체크하면 되니 문제가 전혀 될것이 없었다.내가 고민하는 것은 단하나 "체류시간"뿐이었다. 어떻게 이 체류시간을 계산하느냐...체류시간을 구하는 알고리즘은 간단하다. 페이지 진입시간과 나가는시간만 알면된다.진입시간은 전혀 문제가 되지 않는다.문제는 나가는시간이다.들어오는건 명확한데 나가는건 상황이 다르다.아래는 나가는 상황을 생각난대로 적은것이다. 1. 특정링크로 사이트를 떠나거나2. 브라우저를 닫거나3. 윈도우를 종료하거나4. 전기가 나간다거나 위 상황시..
옛날에 회사다닐때 썻던 소스인데,이번에 안드로이드 프로그램 만들일이 있어서 다시 사용하게 됨~근대 오래되서 기억이 잘 안나네 -_-; 코드이그나이터에서 제작했던 함수임~ public function index(){ //print_r($this->param);exit; $auth = ""; if(count($this->param['pushKeys']) == 0) { exit('Push 식별 번호가 전달되지 않았습니다.'); } $data = array( 'registration_ids' => $this->param['pushKeys'], 'data' => $this->param['input'] ); $headers = array( "Content-Type:application/json", "Authoriz..
도움받은 링크 : https://github.com/xpressengine/xpressengine/issues/322===============================================================https://curl.haxx.se/docs/caextract.html 페이지에서 cacert.pem 파일을 다운로드 받습니다.php.ini 파일에서 curl.cainfo 항목을 찾은 다음, 다운로드 받은 파일의 경로를 아래와 같이 지정한 후, 서버를 재시작합니다. (cacert.pem 파일의 경로가 c:\php\cacert.pem일 경우)curl.cainfo=c:\php\cacert.pem 이 게시글은 https://webschool.kr/?v=board_view&board_..
header( 'Content-type: text/html; charset=euc-kr' ); // Set a valid header so browsers pick it up correctly.header('Content-type: text/html; charset=utf-8');// Explicitly disable caching so Varnish and other upstreams won't cache.header("Cache-Control: no-cache, must-revalidate");// Setting this header instructs Nginx to disable fastcgi_buffering and disable// gzip for this request.header('X-Acc..
라이브러리 다운로드 URL http://phpexcel.codeplex.com/ 사용샘플 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152require_once "./plugin/PHPExcel_1.7.6/Classes/PHPExcel.php"; // PHPExcel.php을 불러와야 하며, 경로는 사용자의 설정에 맞게 수정해야 한다. $objPHPExcel = new PHPExcel(); require_once "./plugin/PHPExcel_1.7.6/Classes/PHPExcel/IOFactory.php"; // IOFactory.php을 불러와야 하며, 경로는 사용자의 설정에..
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647public function get_curl($param){ //print_r($param);exit; $ch = curl_init(); #접속할 URL 주소 curl_setopt($ch, CURLOPT_URL, $param['url']); #FALSE 를 설정하면 cURL는 서버 인증서의 유효성을 검사하지 않습니다.#다른 인증를 CURLOPT_CAINFO 옵션 지정하거나 CURLOPT_CAPATH 옵션 증명서 디렉토리를 지정합니다. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); #SSL 버젼 지정. 기본값은 2 ..
참조 ) http://blog.netchk.net/?p=1032 #크론 다이렉트로 안 걸림. wget, curl, GET 등으로 걸어야 됨.define('AGENT', 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko');define('COOKIE', 'cookie.txt'); $today = date("Y-m-d H:i:s");$url = 로그인url$post_data["Id"] = 로그인아이디;$post_data["Password"] = 로그인패스워드; #http://kr.php.net/manual/kr/function.curl-setopt.php$ch = curl_init();curl_setopt($ch, CURLOPT_UR..
PHP_VALUE max_input_vars 3000 이 게시글은 https://webschool.kr/?v=board_view&board_key=7&idx=336 에서 작성한 글입니다. 소스코드의 경우 해당 블로그에서 이뿌게 노출이 되지 않을 수 있사오니, 위 링크로 들어오셔서 보시길 바랍니다.