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

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Open)
 Registration Form error in line 413 + FIX
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Snake.Xenzia
Starting Member

Italy
2 Posts

Posted - 15 May 2009 :  18:20:24  Show Profile
Hi,
Excuse me for my english.
http://forum.snitz.com/forum/register.asp?mode=Register
if in
Registration Form for Snitz Forums 2000
Contact Info
E-mail Address:
writing without the @ (ex/ aaa)
appears that error message

Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument: 'Mid'
/forum/register.asp, line 413

Why this?
Is there solution?
Thanks and regards

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 16 May 2009 :  03:08:42  Show Profile  Visit HuwR's Homepage
firstly it is because email addresses must contain an @ so your or someone entered an invalide email, however this should be trapped by the code, however the addition of some antispam spam code as broken the eror trap.

I will review the code and post a fix later.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 16 May 2009 :  03:16:28  Show Profile  Visit HuwR's Homepage
here is the fix.

in register.asp, replace this section of code

If strAutoLogon <> 1 then
if Request.Form("Email") = "" then
Err_Msg = Err_Msg & "<li>You Must give an e-mail address</li>"
else
'Comment out down to the next comment to let it take me@example.com and/or .ex as well
'strsql = "SELECT SPAM_SERVER FROM " & strTablePrefix & "SPAM_MAIL WHERE SPAM_SERVER = '" & chkString(Request.Form("Email"),"sqlstring") & "'"
'set rsSpam = my_Conn.Execute (strsql)

'If Not rsSpam.EOF Then
' Err_Msg = Err_Msg & "<li>You cannot register with '" & chkString(Request.Form("Email"),"sqlstring") & "'.</li>"
'End If

'Dim strMailTLD : strMailTLD = LCase(Mid(Request.Form("Email"),InStrRev(Request.Form("Email"),".")))

'strsql = "SELECT SPAM_SERVER FROM " & strTablePrefix & "SPAM_MAIL WHERE SPAM_SERVER = '" & strMailTLD & "'"
'set rsSpam = my_Conn.Execute (strsql)

'If Not rsSpam.EOF Then
' Err_Msg = Err_Msg & "<li>You cannot register with a '" & strMailTLD & "' email address.</li>"
'End If
'Comment out up to the previous comment to let it take me@example.com and/or .ex as well

Dim strMailDomain : strMailDomain = LCase(Mid(Request.Form("Email"),InStrRev(Request.Form("Email"),"@")))

strsql = "SELECT SPAM_SERVER FROM " & strTablePrefix & "SPAM_MAIL WHERE SPAM_SERVER = '" & strMailDomain & "'"
set rsSpam = my_Conn.Execute (strsql)

If Not rsSpam.EOF Then
Err_Msg = Err_Msg & "<li>You cannot register with an '" & strMailDomain & "' email address.</li>"
End If

rsSpam.close
Set rsSpam = Nothing
end if

if Request.Form("Email") <> Request.Form("Email3") then
Err_Msg = Err_Msg & "<li>Your E-mail Addresses didn't match.</li>"
end if

if EmailField(Request.Form("Email")) = 0 then
Err_Msg = Err_Msg & "<li>You Must enter a valid e-mail address</li>"
end if
end if


with this


If strAutoLogon <> 1 then
if Request.Form("Email") = "" then
Err_Msg = Err_Msg & "<li>You Must give an e-mail address</li>"
else
'Comment out down to the next comment to let it take me@example.com and/or .ex as well
'strsql = "SELECT SPAM_SERVER FROM " & strTablePrefix & "SPAM_MAIL WHERE SPAM_SERVER = '" & chkString(Request.Form("Email"),"sqlstring") & "'"
'set rsSpam = my_Conn.Execute (strsql)

'If Not rsSpam.EOF Then
' Err_Msg = Err_Msg & "<li>You cannot register with '" & chkString(Request.Form("Email"),"sqlstring") & "'.</li>"
'End If

'Dim strMailTLD : strMailTLD = LCase(Mid(Request.Form("Email"),InStrRev(Request.Form("Email"),".")))

'strsql = "SELECT SPAM_SERVER FROM " & strTablePrefix & "SPAM_MAIL WHERE SPAM_SERVER = '" & strMailTLD & "'"
'set rsSpam = my_Conn.Execute (strsql)

'If Not rsSpam.EOF Then
' Err_Msg = Err_Msg & "<li>You cannot register with a '" & strMailTLD & "' email address.</li>"
'End If
'rsSpam.close
'Set rsSpam = Nothing
'Comment out up to the previous comment to let it take me@example.com and/or .ex as well

if EmailField(Request.Form("Email")) = 0 then
Err_Msg = Err_Msg & "<li>You Must enter a valid e-mail address</li>"
end if

if(Instr(Request.Form("Email"),"@")) then
Dim strMailDomain : strMailDomain = LCase(Mid(Request.Form("Email"),InStrRev(Request.Form("Email"),"@")))

strsql = "SELECT SPAM_SERVER FROM " & strTablePrefix & "SPAM_MAIL WHERE SPAM_SERVER = '" & strMailDomain & "'"
set rsSpam = my_Conn.Execute (strsql)

If Not rsSpam.EOF Then
Err_Msg = Err_Msg & "<li>You cannot register with an '" & strMailDomain & "' email address.</li>"
End If

rsSpam.close
Set rsSpam = Nothing
end if
end if

if Request.Form("Email") <> Request.Form("Email3") then
Err_Msg = Err_Msg & "<li>Your E-mail Addresses didn't match.</li>"
end if

end if
Go to Top of Page

Snake.Xenzia
Starting Member

Italy
2 Posts

Posted - 16 May 2009 :  18:21:38  Show Profile
Yes, thanks, I understand.
I Shall make the change.

But even in this forum is the error.
Thanks and regards.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 17 May 2009 :  02:43:49  Show Profile  Visit HuwR's Homepage
quote:
Originally posted by Snake.Xenzia
But even in this forum is the error.
Thanks and regards.


Yes, I know, the error is in the base code, I did not imply that it was only you who was affected.
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 17 May 2009 :  03:29:13  Show Profile  Visit modifichicci's Homepage
but the input of email isn't checked from the function EmailField ?
Why
if EmailField(Request.Form("Email")) = 0 then
doesn't work?

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 17 May 2009 :  04:12:25  Show Profile  Visit HuwR's Homepage
quote:
Originally posted by modifichicci

but the input of email isn't checked from the function EmailField ?
Why
if EmailField(Request.Form("Email")) = 0 then
doesn't work?




yes it does, emailfield checks to ensure the email address is of the correct format.

The error reported was caused by the antispam code trying to parse split the email on the @ symbol without ensuring there was actually an @ in the address and was nothing to do with the EmailField function
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 17 May 2009 :  04:49:09  Show Profile  Visit modifichicci's Homepage
but an email without a @ isn't a correct format, or not?
that function doesn't assure a @ in the address?

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 17 May 2009 :  05:03:41  Show Profile  Visit modifichicci's Homepage
it is not why the check on Emailfield in original is after the spam routine and not before?

moving it (as you have done)
the if before the spam routine could be
if EmailField(Request.Form("Email")) <> 0 then

it works on my forum

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 17 May 2009 :  07:29:51  Show Profile  Visit HuwR's Homepage
quote:
Originally posted by modifichicci

but an email without a @ isn't a correct format, or not?
that function doesn't assure a @ in the address?




yes it does, I suggest you look at the function
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 17 May 2009 :  07:31:01  Show Profile  Visit HuwR's Homepage
quote:
Originally posted by modifichicci

it is not why the check on Emailfield in original is after the spam routine and not before?

moving it (as you have done)
the if before the spam routine could be
if EmailField(Request.Form("Email")) <> 0 then

it works on my forum




it doesn't matter where the check is, what I posted fixes the error and works fine. there is no point in calling the function twice which is what you are suggesting.

The fix which stops the error is nothing to do with that function it is the if(Instr(Request.Form("Email"),"@")) which stops the error occuring
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.13 seconds. Powered By: Snitz Forums 2000 Version 3.4.07