如何正确上传包含特殊字符的表单数据? [英] How to upload form data containing special characters correctly?

查看:73
本文介绍了如何正确上传包含特殊字符的表单数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我想知道是否有一些好的页面和/或示例如何使用
正确处理表单数据以便将其放入一个MySQL数据库。


因为我不习惯使用PHP很多,我已经发现

addslashes()可以用来逃避一些人物,但我有更多的问题,例如?,?和μ(因为文本是科学的)

现在有些人也投入htmlspecialchars()将这些转换为

HTML实体,但是有些人将htmlspecialchars()添加到addslashes中( )和

其他人则相反。


是否有一种良好且防错的方法可以确保将其放入

textarea存储后可以安全检索吗?


提前致谢,


Wimmy


-

由曾经被称为奴隶制的人拥有。

现在它被称为承诺。

Hello,

I was wondering if there are a few good pages and/or examples on how to
process form data correctly for putting it in a MySQL DB.

Since I''m not used to using PHP a lot, I already found out that
addslashes() can be used escape some characters, but I''m having some
more problems with for instance ?, ? and μ (since the text is scientifical)
Now some people also throw in htmlspecialchars() to convert those to
HTML entities, but some nest htmlspecialchars() in addslashes() and
others do the opposite.

Is there a good and error proof way of ensuring that what one puts in a
textarea gets stored and can be retrieved safe and sound?

Thanks in advance,

Wimmy

--
Being owned by someone used to be called slavery.
Now it''s called commitment.

推荐答案

尝试:


-
try that:

-


input_string =''带有特殊字符的一些文字'';

-
input_string = ''some text with special characters'';
-


input_string = base64_encode(
input_string = base64_encode(


这篇关于如何正确上传包含特殊字符的表单数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆