태그부분에  the man's car 라고 입력하면 the man\car 이렇게 입력되고 출력이 됩니다.  채택완료

질문:

태그부분에  the man's car 라고 입력하면 the man\car 이렇게 입력되고 출력이 됩니다. 

그리고 다시 한 번 수정하면 the man\\car 라고 수정할 때 마다 \ 한 개씩 더 추가가 됩니다.

그래서 아래와 같이 코드를 수정해 보았는데 원하는 결과 값 the man's car 가 출력이 안됩니다.

어떻게 하면 되나요? 

감사합니다. 

 

 

<!-- 추가 시작 -->

<?php

$as_tag = addslashes($as_tag); 

?>

<!-- 추가 끝 -->

<input type="text" name="as_tag" id="as_tag" value="<?php echo isset($write['as_tag']) ? $write['as_tag'] : ''; ?>" class="form-control" placeholder="콤마(,)로 구분하여 복수 태그 등록 가능">

답변 3개

채택된 답변
+20 포인트

addslashes(); 를 이용해보세요!

https://wickedmagic.tistory.com/580

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

<input type="text" name="as_tag" id="as_tag" value="<?php echo isset($write['as_tag']) ? str_replace("'", "&apos;", htmlspecialchars($write['as_tag'], ENT_QUOTES, 'UTF-8')) : ''; ?>" class="form-control" placeholder="콤마(,)로 구분하여 복수 태그 등록 가능">

위와 같이 수정해서 해보았는데 안됩니다.

 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

<input type="text" name="as_tag" id="as_tag" value="<?php echo isset($write['as_tag']) ? htmlspecialchars($write['as_tag'], ENT_QUOTES, 'UTF-8') : ''; ?>" class="form-control" placeholder="콤마(,)로 구분하여 복수 태그 등록 가능"> 이렇게 수정해서 시도했는데 안됩니다.

 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고