본문 바로가기

Web(html css php)20

CSS 로 한줄, 여러줄로 글자 자르기 (... 붙히기) 한줄자르기 .line1 {display: inline-block;width: 500px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} 여러줄자르기 .line2 {display: -webkit-box;white-space: normal;line-height: 20px;height: 40px;word-wrap: break-word;-webkit-line-clamp: 2;-webkit-box-orient: vertical} 2017. 2. 16.
php 5.5 register_globals 처리 php 5.5에서는 더이상 register_globals를 보안상의 문제로 지원하지않습니다굳이 사용하시려면은소스에 추가해주시면됩니다 @extract($_GET);@extract($_POST);@extract($_SERVER); 2016. 5. 4.
php json_encode 한글(utf8) php 기본 내장 json_encode를 사용하면 한글부분에서 문제가 발생해서 아래와 같이 함수를 구현해서 사용하시면 됩니다. 제가 구현한 함수는 아니고 구글링해서 구한 소스입니다. function json_encode2($data) { switch (gettype($data)) { case 'boolean': return $data?'true':'false'; case 'integer': case 'double': return $data; case 'string': return '"'.strtr($data, array('\\'=>'\\\\','"'=>'\\"')).'"'; case 'array': $rel = false; // relative array? $key = array_keys($data); .. 2015. 12. 7.
IE 브라우저 문서모드, 호환성보기 문제 해결(쿼크모드) 1. html 소스 메타태그로 해결 2. Apache 설정 BrowserMatch MSIE ie Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie Header append Vary User-Agent 3. nginx 설정server { #... add_header X-UA-Compatible "IE=Edge,chrome=1"; } 2015. 12. 7.
php 파일 유무 확인 및 파일 및 폴더 관리 1. 파일 유무 존재 확인 $filename = $_SERVER["DOCUMENT_ROOT"]. "/test.jpg";efho file_exists($filename); 2. 파일삭제함수 $filepath = "../upload/test.jpg"; //파일경로는 상대경로만 가능, 절대 경로는 불가능if( is_file($filepath) ) {unlink($filapath);} 3. 폴더생성 $dirpath = "test";if( !is_dir($dirpath) ) {@mkdir($dirpath, 0777);} 4. 폴더삭제 rmdir($dir); 5. 폴더 내 모든 파일 삭제 후 폴더 삭제 function rmdirAll($dir) {$dirs = dir($dir);while(false !== ($en.. 2015. 12. 7.
html, javascript, jquery 마우스 우클릭 방지(퍼가기방지) - oncontextmenu='return false' - 우클릭방지- onselectstart='return false' - 블럭선택방지 - ondragstart='return false' - 드래그방지 또는 $("body").contextmenu( function() {return false;}); 와 같은 방법으로 처리가능 2015. 12. 7.