ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #16  
Old November 4th, 2009, 06:49 AM
elviscat elviscat is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 185 elviscat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 15 m 13 sec
Reputation Power: 6
Question Javascript in form & security stopped working

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

Reply With Quote
  #17  
Old November 4th, 2009, 07:01 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,838 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 14 h 30 m 10 sec
Reputation Power: 2389
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.

Reply With Quote
  #18  
Old November 4th, 2009, 08:27 AM
elviscat elviscat is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 185 elviscat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 15 m 13 sec
Reputation Power: 6
Question

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.

Reply With Quote
  #19  
Old November 5th, 2009, 02:52 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,838 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 14 h 30 m 10 sec
Reputation Power: 2389
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.

Reply With Quote
  #20  
Old November 12th, 2009, 01:47 PM
elviscat elviscat is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 185 elviscat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 15 m 13 sec
Reputation Power: 6
Hi Shadowwizard,

Thanks for coming back to me I really appreciate your help with this.

the captcha file

Reply With Quote
  #21  
Old November 15th, 2009, 07:00 PM
elviscat elviscat is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 185 elviscat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 15 m 13 sec
Reputation Power: 6
Hi Shadowizard,

Hows it going?

Did you managed to intergrate the captcha into your code at all?

Reply With Quote
  #22  
Old November 19th, 2009, 05:40 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,838 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 14 h 30 m 10 sec
Reputation Power: 2389
Quote:
Originally Posted by elviscat
Hi Shadowizard,

Hows it going?

Did you managed to intergrate the captcha into your code at all?
sorry, was away for a while. if still relevant I'll take a look in your code soon.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Shadow Uploader - Email the uploaded file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek