Solved

https and a security alert

Posted on 2006-11-28
11
356 Views
Last Modified: 2012-06-27
Hi there,
I have a page that is sitting in a secure folder where the user is supose to enter personal information, the main idea of the page is to validate the user date of birth to see if can continue with the application. I have somewhere on my form the following else statament:
 Else
                    Call Response.Redirect("http://www.somewhere.com/volunteer/pdf/VolunteerApplication.pdf")
               End If
of course it has and if but is to long so i don't want to fill this question with unnecesarry stuff ;-)

now on that part of the esle is there a way to change the Security alert that is generete due the change of locations?
right now if the user is not over 18 yeras of age it gets directed to that pdf to print it out and fill it up and submitt it instead of doing it online.
if there is a way! can we replace that alert message for something like you will be redirected to the PDF file becasue you are not over 18 or something like that?
i tihink it has to be inside that else statement
can anyone help me?

Thanks
JSCTECHY
0
Comment
Question by:jsctechy
  • 5
  • 4
  • 2
11 Comments
 
LVL 13

Expert Comment

by:bigbillydotcom
ID: 18030913
is this script inline in the page??
if so, you could break out of script and give them a link to click, something like this

...
else
%>
You are not old enough - please click link below to open a form to download and mail to us  - Thanks Kid!
<a hef="http://www.somewhere.com/volunteer/pdf/VolunteerApplication.pdf">Click Here </a>
<%
 End If
.....resume script
0
 
LVL 1

Author Comment

by:jsctechy
ID: 18030934
thats a good approach but i want soemthing else right now whenever the submit button is clicked i have a security warning and instead of having that i want to change for a message like the one you have
0
 
LVL 13

Expert Comment

by:bigbillydotcom
ID: 18031849
OH - OK
if I understand it correctly, the reason you are getting the security warning is because you are irecting to a folder/document that is not under SSL - right?
Then why not redirect to a page that is under SSL that then has a link as inidicated above

I have also used javascript on a page to redirect to another non-SSL page, but the page you redirect to initially
(the page in the call response.redirect bit) has to be under SSL or will always get this warning

in a nutshell:

SSLpage1.asp (the SSL protected page they are on with the submit button)
on SSLPage1.asp
**********
else
     Call Response.Redirect("SSLTooYoungRedirPage.htm")
end if

SSLTooYoungRedirPage.htm ( the SSL protected page they get redirected to in the "else" bit)

code for SSLTooYoungRedirPage.htm - create new htm page and place this script under body tag
******************************
<script language=javascript>
     window.navigate("http://www.somewhere.com/volunteer/pdf/VolunteerApplication.pdf");
</script>

should redirect without popping up security warning
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 1

Author Comment

by:jsctechy
ID: 18031910
so i have to write just this on my else statemnet just to avoid the alert right?

<script language=javascript>
     window.navigate("http://www.somewhere.com/volunteer/pdf/VolunteerApplication.pdf");
</script>

and how about the message i want to display?
0
 
LVL 13

Expert Comment

by:bigbillydotcom
ID: 18032026
sorry
no

if you want to display the message - create a page with the message and redirect to that page

**********
else
     Call Response.Redirect("SSLTooYoungErrorPage.htm")
end if

then on that page have the message and the link for the pdf file (NEW ANCHOR SCRIPT BELOW - WILL OPEN PDF IN A NEW WINDOW)
*****************************
You are not old enough - please click link below to open a form to download and mail to us  - Thanks Kid!
<a target="_blank" hef="http://www.somewhere.com/volunteer/pdf/VolunteerApplication.pdf">Click Here </a>

I dont think you will get securtiy warning when you popup the pdf using the link - only when you try and do a response.redirect on the server
0
 
LVL 1

Author Comment

by:jsctechy
ID: 18032244
i don't want to redirect the user to another page all i wants is to have a message displaying the rerason why he/she is redirect to that other page or form thats all.

0
 
LVL 13

Expert Comment

by:bigbillydotcom
ID: 18032334
oh ok
sorry - instead of redirecting - just write out to the browser

**********
else
     Response.write("You are not old enough - please click link below to open a form to download and mail to us  - Thanks Kid!")
     Response.write("<br>")
     Response.write ("<a target="_blank" hef="http://www.somewhere.com/volunteer/pdf/VolunteerApplication.pdf">Click Here </a>")
end if
0
 
LVL 13

Expert Comment

by:bigbillydotcom
ID: 18032397
oops
forgot to clean out the dbl quotes in the a href
**********
else
     Response.write("You are not old enough - please click link below to open a form to download and mail to us  - Thanks Kid!")
     Response.write("<br>")
     Response.write ("<a target='_blank' hef='http://www.somewhere.com/volunteer/pdf/VolunteerApplication.pdf'>Click Here </a>")
end if
0
 
LVL 58

Accepted Solution

by:
amit_g earned 500 total points
ID: 18034986
Change

Call Response.Redirect("http://www.somewhere.com/volunteer/pdf/VolunteerApplication.pdf")

to

Call Response.Write("<script>")
Call Response.Write("alert('You are too young');")
Call Response.Write("location.href = 'http://www.somewhere.com/volunteer/pdf/VolunteerApplication.pdf'")
Call Response.Write("</script>")

The warning message you get now is because http getting redirected to https. You can't change that message. You can remove that message if you host the page in the same place where you have your application i.e. in https.
0
 
LVL 1

Author Comment

by:jsctechy
ID: 18036425
amit_g

ok that works exactly the way i want it but i have a question if i create a forlder inside the https folder and now the path change how can i change that line in other to pull the pdf direct from the folder?

>>Call Response.Write("location.href = 'http://www.somewhere.com/volunteer/pdf/VolunteerApplication.pdf'")

instead of having that here is folder that holds the pdf now pdf\VolunteerApplication.pdf

should i just write it like this
Call Response.Write("location.href = 'pdf/VolunteerApplication.pdf'")
?????????
0
 
LVL 58

Expert Comment

by:amit_g
ID: 18038826
Yes that would work as long as the pdf folder is within the same fodler where your asp is.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
One field not displaying content (ASP Classic) 8 31
Connection to multiple databases 13 25
Index on a Table 6 25
alert(innerHTML); 8 32
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question