如何使用stripslashes() [英] how to use stripslashes()

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

问题描述

我正在开发基于php mysql和html的项目,因为我使用更安全的方法来验证登录信息,而不仅仅是获取post变量并将其与数据库进行比较我来自不同的函数,如


isset()

空()

stripslashes()


i得到它直到isset和空,但是当使用stripslashes时,我没有做对,据我所知, stripslashes()的目的是删除任何额外的


''" /和\等



但是当我尝试使用它并在用户名输入字段中我输入了
\omer 并尝试在使用stripslashes后回显它($ _ POST [''FIELD_NAME'']);它仍然显示 \" 在其中

我的代码在这里

展开 | 选择 | Wrap | 行号

解决方案
_POST [ '' FIELD_NAME '']);它仍然显示 \" 在其中

我的代码在这里

展开 | 选择 | Wrap | 行号


<一个rel =nofollowhref =http://uk2.php.net/stripslashestarget =_ blank> stripslashes()只剥回反斜杠。


我无法理解为什么它不起作用= /


mysql_real_escape_string()最好不要使用。 (你需要连接到mysql才能工作)


stripslashes()只剥回反斜杠。


我不明白为什么它不起作用= /


mysql_real_escape_string()最好不要使用。 (你需要连接到mysql才能工作)



是的我也很感激为什么它不起作用但现在我在我的代码中做了一些修改它是

展开 | 选择 | Wrap | 行号


hi there i am working on a project based on php mysql and html now as i was using an more secure method to authenticate login information than simply getting the post variables and comparing it with the data base i came accross different functions like

isset()
empty()
stripslashes()

i got it right till isset and empty but when working with stripslashes i am not getting it right ,as far as i know that the purpose of stripslashes() is to remove any extra

'' " / and \ etc


but as i tried to use it and in username input field i entered
\omer and tried to echo it after using stripslashes($_POST[''FIELD_NAME'']); it still shows the" \ " in it
My code is here

Expand|Select|Wrap|Line Numbers

解决方案

_POST[''FIELD_NAME'']); it still shows the" \ " in it
My code is here

Expand|Select|Wrap|Line Numbers


stripslashes() only strips back slashes.

I can''t understand why it isn''t working =/

mysql_real_escape_string() is better off used. (you need to be connected to mysql for this to work)


stripslashes() only strips back slashes.

I can''t understand why it isn''t working =/

mysql_real_escape_string() is better off used. (you need to be connected to mysql for this to work)

yeah i am also surpeised that why isnt it working but now i have made some ammendments in my code here it is

Expand|Select|Wrap|Line Numbers


这篇关于如何使用stripslashes()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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