|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#16
|
|||
|
|||
|
Hi ShadowWizard,
First off, thanks very much for posting the above bits has really helped me ![]() The only thing that is happening I have some simple javascript form clears on each form item that do not work anymore, and also some captcha code which stopped working. The word document is being picked up to the server, attached and sent to email, however because i have everything in the same page I'm guessing this has something to do with the javascript and captcha not working. Wonder if you might be able to shed any light on the prob or suggest asny solutions, i think it could be something to do with Code:
<form action="<%=Request.ServerVariables( "Script_Name" )%>?action=1" enctype="multipart/form-data" method="POST"> which is forcing the javascript not to work Thanks |
|
#17
|
||||
|
||||
|
most JavaScript form related code is triggered in the onsumit event of the form.
to make it work again, add the code in bold to the form tag: Code:
<form action="<%=Request.ServerVariables( "Script_Name" )%>?action=1" enctype="multipart/form-data" method="POST" onsubmit="return ValidateForm(this);"> replace "ValidateForm" with the real function that used to work, if you don't know its name post your "old" code that used to work and I'll try to see for myself. |
|
#18
|
|||
|
|||
|
Hi m8,
Thanks for the reply, I have the validation working, the problem is the ASP captcha there is a part at the top of the page: Code:
<script language=vbscript runat=server>
Sub HDWCaptchaValidation
If (Request.QueryString("hdwtest") = "captchainstalled") Then
Response.Write "Captcha verification code installed."
Response.End
End If
If (UCase(Request.ServerVariables("REQUEST_METHOD")) = "POST") OR (Request.QueryString.Count >= 4) Then
Dim SessionCAPTCHA, CheckCAPTCHA, HDWCaptchaBack, HDWname
SessionCAPTCHA = Trim(CStr(Session("HDWCAPTCHA")))
Session("CAPTCHA") = ""
HDWCaptchaBack = Request.Form("hdwfail")
If (HDWCaptchaBack = "") Then HDWCaptchaBack = Request.QueryString("hdwfail")
For Each HDWname in Request.QueryString
Response.Cookies("hdw" & HDWname) = Request.QueryString(HDWname)
Next
For Each HDWname in Request.Form
Response.Cookies("hdw" & HDWname) = Request.Form(HDWname)
Next
For Each HDWname in Request.Cookies
On Error Resume Next
If (Left(HDWname,3) = "hdw") AND (Request.QueryString(Right(HDWname,Len(HDWname)-3)) = "") AND (Request.Form(Right(HDWname,Len(HDWname)-3)) = "") Then
If (Err.Description = "") Then Response.Cookies(HDWname) = ""
End If
Next
If (Len(SessionCAPTCHA) < 1) OR ((Request.Form("hdcaptcha") = "") AND (Request.QueryString("hdcaptcha") = "")) OR ((SessionCAPTCHA <> CStr(Request.Form("hdcaptcha"))) AND (SessionCAPTCHA <> CStr(Request.QueryString("hdcaptcha")))) Then
Response.Redirect HDWCaptchaBack
Response.End
End If
For Each HDWname in Request.Cookies
If (Left(HDWname,3) = "hdw") Then
Response.Cookies(HDWname) = ""
End If
Next
End If
End Sub
</script>
<% HDWCaptchaValidation %>
and a hidden value for when it fails: Code:
<input type="hidden" name="hdwfail" id="hdwfail" value="contact_us.asp?hdwmsg=invalid" /> I Have tried using objUpload("") and the relevant variable where ever there is a request.form however there is one place and one only by the looks of it where it won't handle it. (taken from above) Code:
For Each HDWname in Request.Form
Response.Cookies("hdw" & HDWname) = Request.Form(HDWname)
Next
(and changed with objUpload in BOLD is where the problem lies) Code:
For Each HDWname in objUpload()
Response.Cookies("hdw" & HDWname) = objUpload(HDWname)
Next
I'm unsure whether this is the solution or not it just seemed the most obvious? The Captcha is a DW extension, when added to the page the page closes now the upload code is included. i'm thinking theres a conflict somewhere but again unsure Last edited by elviscat : November 4th, 2009 at 08:30 AM. |
|
#19
|
||||
|
||||
|
never seen such complicated code for such simple task as writing
bunch of cookies.... as far as I could see it's pretty meaningless. you can achieve what you need without such code, post your CAPTCHA code itself and I'll try to fix it so it will work with the upload. |
|
#20
|
|||
|
|||
|
Hi Shadowwizard,
Thanks for coming back to me I really appreciate your help with this. the captcha file |
|
#21
|
|||
|
|||
|
Hi Shadowizard,
Hows it going? Did you managed to intergrate the captcha into your code at all? |
|
#22
|
||||
|
||||
|
Quote:
|
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > Shadow Uploader - Email the uploaded file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|