MajorTechie
Programmer
Hello,
I have an "Email this form" button happening.
I want the user to be able to fill in a form instead of popping up an email. So I've written an asp page to do the trick.
The JavaScript code I have to send the url to the form is:
<SCRIPT LANGUAGE="JavaScript1.2">
function mailThisURL() {
var Location = window.location;
var Page = "../email.asp?URL=" + Location;
NewWindow = window.open(Page, "Email", "location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,top=0,left=0,width=361,height=342"
}
</script>
Then I have a form that takes info from the user and passes the URL in a hidden field:
<%@ Language=VBScript %>
<%
Dim URL
URL = Request("URL"
~~~~~~~~~~~~~~
<input type="hidden" name="URL" value="<%=URL%>">
%>
The problem I have is in the third page which actually sends the info. Everything is sending fine but the URL.
<%@ Language=VBScript %>
<%
Dim URL, Content, SenderName, SenderEmail, RecipEmail, Comments, Subject, URL2, URL3
SenderName = Request("SenderName"
SenderEmail = Request("SenderEmail"
Subject = Request("Subject"
RecipEmail = Request("RecipEmail"
Comments = Request("Comm"
URL = Request("URL"
//this is because the URL is being passed in an encoded form
//so I need to decode it
URL2 = Replace(URL, "%3A", ":"
URL3 = Replace(URL2, "%2F", "/"
Content = URL3 + "<p>" + Comments
Set Mail = Server.CreateObject("Persits.MailSender"
Mail.Host = "pop.*****.com"
Mail.From = SenderEmail
Mail.FromName = SenderName
Mail.AddAddress RecipEmail
Mail.Subject = Subject
Mail.IsHTML = true
Mail.Body = Content
On Error Resume Next
Mail.Send
%>
I have an "Email this form" button happening.
I want the user to be able to fill in a form instead of popping up an email. So I've written an asp page to do the trick.
The JavaScript code I have to send the url to the form is:
<SCRIPT LANGUAGE="JavaScript1.2">
function mailThisURL() {
var Location = window.location;
var Page = "../email.asp?URL=" + Location;
NewWindow = window.open(Page, "Email", "location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,top=0,left=0,width=361,height=342"
}
</script>
Then I have a form that takes info from the user and passes the URL in a hidden field:
<%@ Language=VBScript %>
<%
Dim URL
URL = Request("URL"
~~~~~~~~~~~~~~
<input type="hidden" name="URL" value="<%=URL%>">
%>
The problem I have is in the third page which actually sends the info. Everything is sending fine but the URL.
<%@ Language=VBScript %>
<%
Dim URL, Content, SenderName, SenderEmail, RecipEmail, Comments, Subject, URL2, URL3
SenderName = Request("SenderName"
SenderEmail = Request("SenderEmail"
Subject = Request("Subject"
RecipEmail = Request("RecipEmail"
Comments = Request("Comm"
URL = Request("URL"
//this is because the URL is being passed in an encoded form
//so I need to decode it
URL2 = Replace(URL, "%3A", ":"
URL3 = Replace(URL2, "%2F", "/"
Content = URL3 + "<p>" + Comments
Set Mail = Server.CreateObject("Persits.MailSender"
Mail.Host = "pop.*****.com"
Mail.From = SenderEmail
Mail.FromName = SenderName
Mail.AddAddress RecipEmail
Mail.Subject = Subject
Mail.IsHTML = true
Mail.Body = Content
On Error Resume Next
Mail.Send
%>