Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Check if string contains "<" or ">"
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

GhorZonia
New Member

Finland
60 Posts

Posted - 14 August 2001 :  16:31:50  Show Profile  Visit GhorZonia's Homepage
This should be easy for you experienced ASP coders.

How do I check if a string contains "<" or ">"?

Thanks!

Edited by - GhorZonia on 14 August 2001 16:32:31

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 14 August 2001 :  16:56:26  Show Profile
Here is what we used to use in register.asp to test for those:

	if (Instr(Request.Form("Name"), ">") > 0 ) or (Instr(Request.Form("Name"), "<") > 0) then
Err_Msg = Err_Msg & "<li> &gt; and &lt; are not allowed in the UserName, Please Choose Another</li>"
end if
Go to Top of Page

Spoon
Average Member

Ireland
507 Posts

Posted - 14 August 2001 :  16:56:31  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
quote:

This should be easy for you experienced ASP coders.

How do I check if a string contains "<" or ">"?

Thanks!

Edited by - GhorZonia on 14 August 2001 16:32:31




STRING_NAME = Request.Form("STRING") 'etc etc, change as necessary

If InStr(STRING_NAME,"<") OR InStr(STRING_NAME,">") Then

'Do whatever you want if it contains the > or <

End If


Regards - Spoon

Begineer? Need help installing the forums? - www.aslickpage.com/snitz_help.html

www.ASlickPage.com - Private Messaging


Edited by - spoon on 14 August 2001 16:58:13
Go to Top of Page

Spoon
Average Member

Ireland
507 Posts

Posted - 14 August 2001 :  16:59:06  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
quote:

Here is what we used to use in register.asp to test for those:

	if (Instr(Request.Form("Name"), ">") > 0 ) or (Instr(Request.Form("Name"), "<") > 0) then
Err_Msg = Err_Msg & "<li> &gt; and &lt; are not allowed in the UserName, Please Choose Another</li>"
end if




g richard, thx for stealing my glory!!!

Regards - Spoon

Begineer? Need help installing the forums? - www.aslickpage.com/snitz_help.html

www.ASlickPage.com - Private Messaging
Go to Top of Page

GhorZonia
New Member

Finland
60 Posts

Posted - 15 August 2001 :  07:53:45  Show Profile  Visit GhorZonia's Homepage
Ahh, thanks to both of you.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07