?insert into cz_game_account_ios(role, contact_way, qufu, qufu_type, account,password) value('fgh'ggg', '18825156665', 'fgh'ggg', '', 'fgh'ggg', 'fgh''ggg'):(SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ggg', '18825156665', 'fgh'ggg', '', 'fgh'ggg', 'fgh''ggg')' at line 2我是用thinkphp框架的 我的變量是有 I('post.name');的 我想在用填什么我就將其保存到數(shù)據(jù)庫,在保存需要保證安全(轉(zhuǎn)化),但是讀出來就有用輸入的原樣 ?比如 用戶 輸入 <script>alert('fgs'dfg')</script> 入庫后 輸出還是?<script>alert('fgs'dfg')</script> ? 我希望存庫時時這種的<p>gdsfgsdf&#39;dfdf &nbsp;&lt;p&gt;fdgvsd&#39;dfsdf&a ?謝謝大神們 求幫 謝謝
3 回答

風(fēng)雨兼程
TA貢獻10條經(jīng)驗 獲得超26個贊
使用反斜線("\")轉(zhuǎn)義,比如:
<?php ????echo?'<img?src="123.jpg"?title="title"?feature=\'{"colors":?"#5b5958","draggable":?true"?}\'?/>'; ?>
- 3 回答
- 0 關(guān)注
- 2941 瀏覽
添加回答
舉報
0/150
提交
取消