帮助从url变量中删除特殊字符 [英] Help removing special character(s) from url variable

查看:116
本文介绍了帮助从url变量中删除特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从一个aspx页面(LOGON_USER)调用一个变量到一个url,需要删除特殊字符\所以用户可以正确登录。


我正在使用:

I am calling a variable from an aspx page (LOGON_USER) into a url and need to remove the special character "\" so the user can be logged in correctly.

I am using:

展开 | 选择 | 换行 | 行号

推荐答案

我看到url中没有反斜杠...(单个反斜杠会自动转义后面的字符或插入相应的特殊字符)
I see no backslash in the url... (a single backslash will automaticly escape the following character or insert the appropriate special character)


反斜杠位于URL中调用的服务器变量中(LOGON_USER)

变量(LOGON_USER)= acct ... \ ....基于访问此页面的用户。 />
例如: http://testsite.com:1001/forms/html/...ss= acct01 \ sams


在IE中,它用正方形替换反斜杠并删除第一个s ......就像这样:
The backslash is in the server variable that is called in the URL (LOGON_USER)
The variable (LOGON_USER) = acct...\.... based on the user accessing this page.
Eg: http://testsite.com:1001/forms/html/...ss=acct01\sams

In IE, it replaces the backslash with a square and removes the first s...like this:
展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号


@doublestack


这是因为\\\是一个特殊的char。在传递变量之前,您需要转义反斜杠(您可能需要在服务器上执行此操作)。
@doublestack
that''s because \s is a special char. before you pass the variable you need to escape the backslash (you''ll probably need to do that on the server).


这篇关于帮助从url变量中删除特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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