Case Sensitive In Replace Function In ASP

I use a replace char function to remove any bad words from user's input to prevent SQL injection. Here is what I use:

Function killChars(strWords)
Dim badChars, newChars
badChars = Array("bad words here")
newChars = strwords
For i=0 to uBound(badChars)
newChars = replace(newChars, badChars(i), "")
next
killChars=newChars
End function

Now the problem is if a user enter "DeLETe" in the input box, and this word is not get removed before entering the DB. because I entered "delete" in the badchars array.

so how can I enable a case sensitive in my function? So the bad words would get deleted regardless its in upper or lower case?

View Replies


ADVERTISEMENT

Upper Case Issue In Replace Function

I just realized that when I do a replace:

replace(rs("IMAGE"),".jpg","")

it replaces all instances of a lower case .jpg but not the upper case
..JPG

How can I fix this?

View Replies View Related

Case Sensitive

i have this on my signup page
Set rs = Conn.Execute("SELECT * from rounds")

DO WHILE NOT rs.EOF

IF request.form("username") = rs.fields.item("username").value THEN

response.redirect("register2.asp")

END IF

rs.MoveNext
LOOP

the problem is.. some who signed up as say Jeff can still sign up as jeff
or jeFF how can i fix this??

View Replies View Related

Case-sensitive

My problem is like this:

http://www.4guysfromrolla.com/webte...q022400-1.shtml

But I use ASP + Access (Jet SQL 4)

View Replies View Related

Not A Case Sensitive Search?

Below is my sql search code in my asp page. But my search seems to be case sensitive. How can i modify it to make it not case sensitive?

<%
sqlString = "SELECT product_image, product_name, product_description, product_price " &_
"FROM Products " &_
"WHERE product_status = 1 " &_
"AND ( product_name LIKE '%" & searchFor & "%' " &_
"OR product_description LIKE '%" & searchFor & "%') " &_
"ORDER BY product_name "

SET RS = Conn.Execute( sqlString )
IF NOT RS.EOF AND searchFor <> "" THEN
%>

View Replies View Related

Case Sensitive Password

I have tried searching various sites including this one and I cant find a straight forward answer.


Code:

strSQL = "SELECT user.username FROM user WHERE username = '" & myUsername & "' AND password = '" & myPassword & "';"

How do I check for case sensitivity?

View Replies View Related

Case Sensitive Password

how can I make the password entered into a database case sensitive when a user tries to sign in?

View Replies View Related

InSTR Is Case Sensitive

Just used this code and noticed it doesn't always work, turns out InStr is case sensitive.What's thet best way to do a non-case sensitive search?pHP Code:

IF INSTR(VideoName,"HiRes") THEN 

View Replies View Related

Case Sensitive Queries

any way of searching a database without case sensitivity? Make any sense?! I have an Access 2000 db with 11 fields in it: Name, Keywords..., Description... But whenever I try to search through it using the ASp site I made, it'll only find matches if they are written identically, I.E a search for "bob" won't find the entry "Bob".

I thought about making the entire contents of the db Uppercase, but I don't want to, as that would look crap when the contents are displayed in the website.

View Replies View Related

Not A Case Sensitive Search

Below is my sql search code in my asp page. But my search seems to be case sensitive. How can i modify it to make it not case sensitive?

<%
sqlString = "SELECT product_image, product_name, product_description, product_price " &_
"FROM Products " &_
"WHERE product_status = 1 " &_
"AND ( product_name LIKE '%" & searchFor & "%' " &_
"OR product_description LIKE '%" & searchFor & "%') " &_
"ORDER BY product_name "

SET RS = Conn.Execute( sqlString )
IF NOT RS.EOF AND searchFor <> "" THEN
%>

View Replies View Related

Case Sensitive Files

i have developed an application with some of the files name myfile.asp, others TheFile.asp and others THATFILE.asp, that is i change the case in the names of the files. everything works on my pc, however i don't have much of cross-browser experience and before lauching it, i want to know if would matter or not? would it make any difference on Netscape, IE earlier versions, firefox, opera and so on.

in some of my files i use username, others UserNAME, others User Name and so it hereby used Request.form("username") or Request.form("User Name") Does this also makes any difference? I am basically talking about cross-browser viewing of the application.

View Replies View Related

Case Sensitive Data

When a read a field (string) in my script and checks whether it matches user input or not, the comparison is case sensitive. Eg Code:

x=objRS1.Fields("Login_Name")
If (x=User_Input_Variable) Then
Code
End If

How do I drop the case sensitivity?

View Replies View Related

Case Sensitive Search

I have some stored values in a DB. When I search for a username I don't want to retrieve anything unless all characters match exactly. Assume a user has chosen "HeLLo" for username. Then I don't want the SQL string to store that name in the recordset when names like "hello" or "Hello" is searched.

The way my code works now, it doesn't pay any attention to whether it is lower or upper case. How can I search a DB and only store the values in the recordset if all cases match?

View Replies View Related

How To Determine Case Sensitive Text

I want to know how case sensitive works...simple code for an idea..thanks

View Replies View Related

Replace() Case

Is replace case sensitive?

View Replies View Related

Replace() And Case Sensitivity

I am using the following replace() function:Code:

temp = Replace(temp,arr(i), "<a class=""definition"" title=""" & arr(i) & """ href=""digital-signage-glossary-of-terms.asp?modes=3&col=keywords&term=" & arr(i) & """>" & arr(i) & "</a>",1,-1,1)

The problem is that it does not appear to be case insensitive (even though I specified the "textual" argument as seen above.) For example, if "BPS" is a term in the array, but "bps" is in the "temp" variable, it will not get replaced.

View Replies View Related

Make Asp "case-sensitive"

how do we make asp check the case of the strings entered.i currently have a running db login... the thing is that i cant make asp check the case of the passwords entered..... and my search pages cant distinguish between "product" and "product" in a search page

View Replies View Related

Replace Function Not Replacing What I Tell It To Replace

If I replace "a" with "b", and then I replace "b" with "a", shouldn't I get the same result? That is what I am trying to encode and decode with Replace() function, but it is giving me different things when I replace and replace again. Here is what I am talking about: Code:

View Replies View Related

Proper Case Function

I saw the Proper Case function a long time ago and I can't seem to find it by search. Does anyone have the code?

View Replies View Related

ASP Replace Function

I've tried EVERY way i can think of to do this replace function, basically when i go to insert "Do's and Dont's into the database it cuts it off at "Do" because of the ' now ill show you my section of code that i have it in currently:

curdescription = trim(replace(arrTemp(4), "'", "''"))

I have it this way and it doesnt work, and i even had it

curdescription = trim(arrTemp(4))
curdescription = replace(curdescription, "'", "''")

View Replies View Related

Replace Function

I'm trying to use the replace function to change a variable ie like this:-
replace folder_old, txtOldFoldername,folder_rename

folder_old = c:DocumentsRoot_Testob
txtOldFoldername = bob
folder_rename = newfoldername

all i want to do is to beable to change the name bob to the new folder, is there a easier way to do this or am I on the right track. if i do the replace like this replace(folder_old, " & txtOldFoldername & "," & folder_rename & ")
i get this error:-
Cannot use parentheses when calling a Sub

View Replies View Related

Replace Function

how can i replace all single quotes in a string to double quotes:

Replace(strLog_text, "'", """)

however, this doesn't work, as you might expect.

View Replies View Related

Replace Function

I'm trying to replace the pipe character with a null value? Is that possible?I'm trying the following:

Replace(Request("strategyA"), "|", "")

I can't get it to work.Is my syntax incorrect?

View Replies View Related

The Replace Function

I'm making an email system, except it doesn't work when the name has spaces in it. Therefore, I want to replace these with "%20"s. Code:

View Replies View Related

Replace Function

I have this code i would like to replace some html in a file with nothing before i insert into db. I am getting this error

Microsoft VBScript compilation error '800a0409'

Unterminated string constant Code:

View Replies View Related

Replace Function

I need to replace several letters to different strings ,I need it in one variable .How can I do that?

If InStr(1,request.form("S8"),"A",1)>0
or InStr(1,request.form("S8"),"B",1)>0
or InStr(1,request.form("S8"),"C",1)>0 then

a=Replace(request.form("S8"),"A","You could use occasionally")
b=Replace(request.form("S8"),"B","You could use often")
c=Replace(request.form("S8"),"C","You would actively promote")
End if

View Replies View Related

Replace Function

I want a replace function which replaces all double quotes with single quotes.
eg :-- It'''''s my post.

So after replacing it shud give me -- It's my post.Basically i want a recursive replace function.

View Replies View Related

Replace Function

i am new to asp and i am having problems using the replace() function to replace occurrences of text in a string.basically what i want to do is replace any occurrences of a double quote (") in a string with "

the code i am using looks like this:
set overview=replace(overview,"""",""")

but when i run load the page i get the following error:
Microsoft VBScript runtime error '800a01a8'
Object required: '[string: "A 13 year old girl p"]'
/ASP/index.asp, line 58

did i get the syntax wrong? i figured that if i was looking for a single quote that i just had to put an escaped double quote "" inside of the quotes.

View Replies View Related

Add Replace Function

I am trying to make the user input form more secure and so I want to use this piece of code

[vbs]Replace(strInput, "'", "''")[/vbs]
but my sql query (which already works) looks like this
[vbs]insSQL = "insert into Details
(ServiceName, Bor_ID, Address, Postcode, Tube, Rail, Bus, Parking,
Tel, Fax, Minicom, Email, Contact, Opening, Eligibility, Access,
OtherFacil, Special, Internet, Other, Cat_ID, URI_ID, Db_ID, Des_ID, Main_ID)
values ('" & Request.Form("ServiceName") & "','" & Request.Form("Borough") & "','" & Request.Form("Address") & "','" & Request.Form("Postcode") & "','" ...[/vbs]
How am I best to implement the code? I tried to do this
[vbs]& Replace(Request.Form("ServiceName"), "'", "''") &[/vbs]
in the actual sql query but I got this error
[vbs]Data type mismatch in criteria expression. [/vbs]

How is it best to do this?

View Replies View Related

Replace Function

I have searched so many "Replace" function topics, but there is something that I don't understand....I found some like this... Replace(strField, " ' ", " ' ' ") .... do anyone knows what's the use of replacing ' with ' ' ?

View Replies View Related

Replace Function

I need help with this one line of code that im having trouble putting together.

[VBS]<%= Replace(Recordset.Fields.Item("MyField").Value,"<" "& lt")%>[/VBS]

this allows me to display raw code on a page that is entered into an Access memo field. Trouble is it all comes out in one line, so i tried adding a [VBS]VbClRf, "<BR>"[/VBS] to it and am getting string errors. Ive tried a few variations and it's really bugging me.

View Replies View Related

Replace Function

I was wondering if any one could help me, I'm try to insert this info in to my database o'farrel and I'm using this Code:

mail1 = replace(Request.Form("email1"),"'","''")

when it inserts the information it looks like this for the email link O'f&#111@site.com .

View Replies View Related

Replace Function

i have stuffed some comment from database within teaxtarea, problem is text are displaying as cobination of data and html tag like <br> (data and <br>) like as follows
this is the first line means<br> this is the second line. i wrote replace code as comment=replace(comment,vbcrlf,"<br>") while adding this comment to database. how could i come out from this problem.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved