stripslashes 문제가 해결이 안되네요 ㅠ..ㅠ 정보
stripslashes 문제가 해결이 안되네요 ㅠ..ㅠ본문
친구관리의 메모부분에 addslashes가 없어서 따옴표나 쌍따옴표가 들어가는 경우에 문제가 있었습니다.
헐랭이님께서 알려주셔서 수정을 했는데... 문제가 하나 생겼습니다. 관련된 해결법을 한시간째 찾는데
아직 못 찾았어요. ㅠ..ㅠ
<input type="type" class="ed" name="fr_edit_<?=$row[fr_no]?>" size="30" value="<?=get_text(stripslashes($row[fr_memo]))?>" />
text box의 value를 지정하는데 value 옆에 쌍 따옴표를 썼더니 ... $fr_memo에 쌍 따옴표가 있으면 이상하게
처리가 됩니다. 이경우 쌍따옴표를 없애는거 이외에 다른 방법은 없을까요??? ㅠ..ㅠ
아래처럼 했더니 애러가 나오더군요. ㅠ..ㅠ
<input type="type" class="ed" name="fr_edit_<?=$row[fr_no]?>" size="30" value="<?=replace( get_text(stripslashes($row[fr_memo])), '"', char(34)) ?>" />
<input type="text" name="subject" value="<%=subject%>">
위에 처럼 쓰면 쌍따옴표가 들어간 데이터가 있으면 공백으로 나온다
이럴때 입력하는 부분의 소스에는
replace(CheckValue, chr(34), """)
보여주는 부분의 소스에는
replace(CheckValue, """", chr(34))
또는
replace(CheckValue, """, chr(34))
이렇게 하면 게시판 등의 수정 페이지에서 쌍따옴표가 있어도 처리가 가능하다
댓글 전체

<input type="type" class="ed" name="fr_edit_<?=$row[fr_no]?>" size="30" value="<?=preg_replace("/\"/", """, get_text($row[fr_memo], 0))?>" />
로 해보세요....^^
로 해보세요....^^

textarea를 사용해보세요.
<textarea class="ed" name="fr_edit_<?=$row[fr_no]?>" cols="30" rows=2><?=get_text(stripslashes($row[fr_memo]))?></textarea>
<textarea class="ed" name="fr_edit_<?=$row[fr_no]?>" cols="30" rows=2><?=get_text(stripslashes($row[fr_memo]))?></textarea>
<input type="type" class="ed" name="fr_edit_<?=$row[fr_no]?>" size="30" value="<?=preg_replace("/\"/", """, stripslashes(get_text($row[fr_memo],0)))?>" />
이렇게 하니까 되네요. 정규식은 넘 어려워요. ㅠ..ㅠ 거의 암호수준 ㅠ..ㅠ
이렇게 하니까 되네요. 정규식은 넘 어려워요. ㅠ..ㅠ 거의 암호수준 ㅠ..ㅠ

그나저나 이페이지 보려면 왜 에러창이 뜨는가용?....ㅋ.ㅋ
제 코드는 원래 버그 투성이랍니다. ㅋㅋ
덕분에 친구관리 다 끝냈습니다. 헐랭이님께서 주신 숙제 끝~!!!
덕분에 친구관리 다 끝냈습니다. 헐랭이님께서 주신 숙제 끝~!!!