第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

缺少小于 ( < ) 和大于 ( > ) 特殊字符的 HTML POST

缺少小于 ( < ) 和大于 ( > ) 特殊字符的 HTML POST

PHP
慕村225694 2021-10-15 16:03:04
使用解決的問題$_REQUEST['editor1']而不是 $_POST['editor1']。不完全確定為什么。希望對遇到這個奇怪問題的人有所幫助。============================================問題描述:我正在將 CKeditor 集成到我的 HTML 表單中。Ckeditor 成功顯示在表單上,我可以輸入一些數(shù)據(jù)。但是當我嘗試發(fā)布表單以存儲在數(shù)據(jù)庫中時,我注意到數(shù)據(jù)庫條目缺少所有 HTML 左括號和右括號。試圖在互聯(lián)網(wǎng)上搜索但沒有運氣。請指教。我的數(shù)據(jù)庫字段具有文本類型。我已經(jīng)用 TinyMCE 替換了 Ckeditor,但還是一樣。<div class="form-group">    <label for="content"><?=$str['content']?></label>        <div class="input-group mb-3">        <textarea class="ckeditor" cols="80" id="editor1" name="editor1" rows="20"></textarea>    </div></div><!-- Initializing the editor --><script src="//cdn.ckeditor.com/4.12.1/full/ckeditor.js"></script><script type="text/javascript">    CKEDITOR.replace( 'editor1' );</script>我嘗試使用以下數(shù)據(jù)輸入 ckeditor textarea:<h3><a href="https://stackoverflow.com/questions/22904776/insert-ckeditor-html-code-into-the-database">Insert ckeditor html code into the database - Stack Overflow</a></h3><p>&nbsp;</p><p><a href="https://stackoverflow.com/questions/22904776/insert-ckeditor-html-code-into-the-database"><cite>https://stackoverflow.com/questions/.../insert-ckeditor-html-code-into-the-database</cite></a></p>但是當我存儲在數(shù)據(jù)庫中或檢索 $_POST['editor1'] 數(shù)據(jù)時,我得到了這個:h3a href=https://stackoverflow.com/questions/22904776/insert-ckeditor-html-code-into-the-databaseInsert ckeditor html code into the database - Stack Overflow/a/h3 p /p pa href=https://stackoverflow.com/questions/22904776/insert-ckeditor-html-code-into-the-databasecitehttps://stackoverflow.com/questions/.../insert-ckeditor-html-code-into-the-database/cite/a/p缺少所有左括號和右括號。我做錯了什么?下面是存儲數(shù)據(jù)的代碼:if (isset($_POST['submit'])) {    $host     = DB_HOST; /* Host name */    $user     = DB_USER; /* User */    $password = DB_PASS; /* Password */    $dbname   = DB_NAME; /* Database name */    $con = mysqli_connect($host, $user, $password, $dbname);// Check connection    if (!$con) {        die("Connection failed: " . mysqli_connect_error());    }
查看完整描述

3 回答

?
元芳怎么了

TA貢獻1798條經(jīng)驗 獲得超7個贊

使用html_entity_decode轉換HTML實體成HTML標簽

echo html_entity_decode($_POST['editor1']);

參考鏈接在這里


查看完整回答
反對 回復 2021-10-15
?
慕后森

TA貢獻1802條經(jīng)驗 獲得超5個贊

使用此檢查:mysqli_real_escape_string()同時添加到數(shù)據(jù)庫


查看完整回答
反對 回復 2021-10-15
  • 3 回答
  • 0 關注
  • 206 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號