사이트 내 전체검색
PHP
따옴표 처리해서 DB저장 및 없애고 출력
로빈아빠
https://cmd.kr/php/323 URL이 복사되었습니다.

본문

- db입력시

$text = $_REQUEST['text'];

$text = addslashes($text);

insert into.......... values('$text');

 

- 페이지 출력시

echo(stripslashes($row[text]));

 

 

 

* addslashes(문자열) - 입력시 사용

* stripslashes(문자열) - 출력시 사용

댓글목록

등록된 댓글이 없습니다.

PHP
871 (5/18P)

Search

Copyright © Cmd 명령어 18.116.87.250