본문 바로가기

컴터/php

(23)
ajax 시 php 로 파로 xml 만들어 보낼때 자바스크립트 객체 에러 나는고.. header("Content-type: text/xml; charset=utf-8"); 상단에 xml 임을 선언 않 해 주어서 그런듯.. 난 이렇게 하니 에러가 사라졌다.. 예.. for($i=0;$i 참고.. http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=qna_ttrend&wr_id=1539
setcookie 이전에 출력결과가 있을때 피해서 굽기 ob_start(); setcookie("ccid", 'kimyh003', time()-3600); ob_end_clean(); ----------------------------------------------------------------------------- 내가 생각하는 ob_ 함수들. ob_start() : 버퍼 시작. ob_end_clean() : 출력 버퍼 작업을 끝내고 그동안의 버퍼 내용을 비운다 ob_end_flush() : 출력 버퍼 작업을 종료(끝내고)하고, 버퍼의 내용을 출력한다. ob_flush() : 버퍼에 담은 내용을 출력한다. ob_get_contents() : 버퍼 시작후 내용을 담는다. (이후에 버퍼 종료 나 비우는 함수를 호출) ob_get_clean() : 버퍼 내..
download 페이지 header기 때문에 절대 최상단에 어떤 문자 특히 공백이 와서도 안됨....
Thumbnail ..만들기.. 썸네일 크기 정하고 같은 비율로 만들되.. 가로 세로 틀릴경우 검은 공백으로 메꾸기... if(strtolower($_ext) == ".jpg"){//확장자가 jpg일때.. $imgSize=getimagesize($path.$_uploadName.$_ext); if($imgSize[2] == 2 && ($imgSize[0]>220 || $imgSize[1]>220)){ //////////making thumbnail only jpg ///thumbnail size.. $bi = ($imgSize[0] > $imgSize[1]) ? round(220 / $imgSize[0],2) : round(220 / $imgSize[1],2); $width = $imgSize[0]*$bi; $height = $imgS..
달라진 php5 출처 : http://www.zend.com/php5/articles/engine2-php5-changes.php#Heading12 New Object Model PHP's handling of objects has been completely rewritten, allowing for better performance and more features. In previous versions of PHP, objects were handled like primitive types (for instance integers and strings). The drawback of this method was that semantically the whole object was copied when a variab..
php5 에서 try{}catch{}사용 class MyException {    function __construct($exception) {        $this->exception = $exception;    }    function Display() {        print "MyException: $this->exception\n";    } } class MyExceptionFoo extends MyException {    function __construct($exception) {        $this->exception = $exception;    }    function Display() {        print "MyException: $this->exception\n";    } } try {    throw ..
eacape 문자열 처리 ** eacape 문자열 처리 ** - \% : % 기호 검색 시에 사용되는 % 문자가 아닌 그냥 문자 - \_ : _문자 검색 시에 사용되는 _ 문자가 아닌 그냥 문자 - \' : 작음따옴표(') - \" : 큰따옴표(") - \\ : 역슬래쉬(\) - \r : 캐리지 리턴 - \n : 새로운줄 - \t : tab문자 - \b : backspace 문자