addslashes有问题 [英] Problem with addslashes

查看:56
本文介绍了addslashes有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我需要一些帮助/建议快。


我的网络服务器上有addlashes的问题。上传文件后,我将读取上传的文件,在读取数据上使用addslashes,然后将其插入到MySQL数据库的blob字段中。



问题是这在我的内部测试网络服务器上工作正常(在RedHat 7.3下运行

)。但是在我的生产网络服务器上(运行Fedora Core 4)

它失败。相同的功能在两台服务器上创建不同的输出。

prod服务器上的数据已损坏。


我在上传脚本中添加了代码addslashes返回的数据

到一个文件。然后我比较了在两台服务器上创建的这个文件(基于

相同的上传文件)。它们的内容和长度都不同。


两台服务器都使用相同版本的Apache,PHP和MySQL。唯一的

差异是操作系统。


我使用PHP ver 4.3.9,Apache ver 2.0.52和MySQL ver 4.1.8


-

J?rn Dahl-Stamnes
http://www.dahl-stamnes.net/dahls/

Hello folks,

I need some help/advice FAST.

I have problems with addslashes on my web-servers. After uploading a file, I
read the uploaded file, use addslashes on the read data and then insert it
into a blob field in a MySQL database.

The problem is that this works fine on my internal test web-server (running
under RedHat 7.3). But on my production web-server (running Fedora Core 4)
it "fails". The same function create different outputs on the two servers.
The data on the prod server is corrupted.

I added code to the upload script that dumps the data returned by addslashes
to a file. I then compared this file created on the two servers (based on
the same uploaded document). They are different both in content and length.

Both servers use the same version of Apache, PHP and MySQL. The only
difference is the OS.

I use PHP ver 4.3.9, Apache ver 2.0.52 and MySQL ver 4.1.8

--
J?rn Dahl-Stamnes
http://www.dahl-stamnes.net/dahls/

推荐答案

此功能被称为魔术引号。它是PHP.INI中的一个设置。


-

Willem Bogaerts


申请史密斯
Kratz BV
http://www.kratz.nl/
This feature is called "magic quotes". It is a setting in PHP.INI.

--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/


Willem Bogaerts写道:
Willem Bogaerts wrote:

此功能称为魔术引号。它是PHP.INI中的一个设置。
This feature is called "magic quotes". It is a setting in PHP.INI.



我在两台服务器上使用相同的php.ini文件。所有

''魔术''关键字的当前设置:


magic_quotes_gpc = On

magic_quotes_runtime = Off

magic_quotes_sybase =关


这是正确的设置还是?


我也尝试安装php 4.4.5,因为我发现在addslashes中可能存在一个错误

。它没有帮助,但我现在收到消息已上传的

文件仅部分上传上传大文件时(112 Kb)。 A

较小的文件(69Kb)工作正常。


-

J?rn Dahl-Stamnes
< a rel =nofollowhref =http://www.dahl-stamnes.net/dahls/target =_ blank> http://www.dahl-stamnes.net/dahls/


Willem Bogaerts写道:
Willem Bogaerts wrote:

此功能称为魔术引号。它是PHP.INI中的一个设置。
This feature is called "magic quotes". It is a setting in PHP.INI.



我已经检查了一下,它不会影响上传的

文件的内容。

恕我直言,我看不出这与我的问题有什么关系。


-

J?rn Dahl-Stamnes
http://www.dahl-stamnes.net/dahls/ br />


这篇关于addslashes有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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