Link to home
Start Free TrialLog in
Avatar of jsctechy
jsctechyFlag for United States of America

asked on

https and a security alert

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
Avatar of bigbillydotcom
bigbillydotcom

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
Avatar of jsctechy

ASKER

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
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
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?
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
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.

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
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
ASKER CERTIFIED SOLUTION
Avatar of amit_g
amit_g
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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'")
?????????
Yes that would work as long as the pdf folder is within the same fodler where your asp is.