Details and vulnerability and protection of TRIM functions in ASP programming

xiaoxiao2021-03-06  108

<"CASE"> "Result = result " "Case Chr (34) Result = result " "" Case "&" Result = Result "&" above code converts some HTML tags Case Chr (255) 'Prevent Special Spaces Result = Result Case Chr (13) 'Prevent Auto-Cargo Result = Result "" Case Chr (10)' Prevents Removal Result = Result "" Case Else Result = Result MID (STR, I, 1) End Select Next Xuankong = Result End Function Then use this function in your ASP program, such as: name = xuankong (TRIM (Request.form ("name")))) Because the character 0-z ASC code is 48-122 this section, So the following method can be used: DIM J J = LEN (Trim (Request.form ("Name"))) for i = 1 To J IF ASC (MID (Name, I, 1))> 122 or ASC (MID (Name, I, 1)) <48 THEN RESPONS..REDIRECT "Error.asp? error = special" NEXT Although this "space" has not found the problem of destroying the program, but it is still a mess, or It's good, but this space has a benefit. If you have to get online password, hen ... I am afraid not a few people can see it! It's been thinking that it is Space, but it is not ... The author is not familiar with PHP and JSP, so I don't know if this problem will present in these two things.

转载请注明原文地址:https://www.9cbs.com/read-100270.html

New Post(0)