Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Taking out " " (Spaces) with ASP 1

Status
Not open for further replies.

brentnewbury

Programmer
May 1, 2001
30
GB
Hi everyone,

I was testing my new user authorisation and details script and found a small but fatal bug. I could just input a space as my username and password. So I found a little function to do the job, but it didn't. The script was:

Replace(Request.Form("username"), " ", "")

and it came up with this error:

Microsoft VBScript compilation (0x800A0414)
Cannot use parentheses when calling a Sub
/login/signup.asp, line 2, column 43
Replace(Request.Form("UserEmail"), " ", "")
-------------------------------------------------^

I don't have a clue what this means and all, but if someone could tell me where I'm going wrong, or suggest a new script. All I want to do is takeout or notify the user of invalid chars like scace and the '.

Thank you for your time,

Brent Newbury
 
try this:

dim username

username = Replace(Request.Form("username")," ", "")

Hope this helps


GH
 
Hi giahan,

Thankyou very much for your reply, it did work, and I am very disapointed in myself for not thinking of this simple yet effective method.

Thnx again,

Brent Newbury
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top