Hi Guys
Deployment: Website on 2003 server
language classic-ASP/VBS
IIS 6.00
I have the link below to provide customers with price catalog on website
<A href = "misc/Price_Catalog.pdf">Click here to download a price catalog</A>
I have an email code snippet which sends me email confirmations etc
Is there a way to run the a code snippet only when the link above is clicked?
Thank u
Dory
Microsoft DevelopmentHTMLASP
Last Comment
dory550
8/22/2022 - Mon
scrathcyboy
sure, just change the link to that below in the code snippet. The onClick="countClick():" part can count the clicks, or initiate an email giving you the email per click. You would put a small form around the link ,and in the javascript function countClick(), you would, at the end of it use --
document.form1.submit();
form1 is the name of the form, and it submits to a server script whatever you want to be emailed to you.
<A href = "misc/Price_Catalog.pdf" onClick="countClick();>Click here to download a price catalog</A>
scratchyboy
Thanks fo your response
I am not sure How to make your solution work for me.
I need to get an email with customer number sent to me
I have in place a vbs/asp sub that does just that each time that web page is visited
But not all visits result in a catalog being downloaded
hence my request for assistance.
Dory
"I have in place a vbs/asp sub that does just that each time that web page is visited"
Why not have the ASP/VBS script do that when the link is clicked, not when the page is viewed. It makes more sense to do it when the person is interested, not merely curious. Can you not do that?
<% @ LANGUAGE="vbscript" %>
<%
email1
response.redirect "misc/catalog.pdf"
Sub email1
set objmail=CreateObject("CDO.Message")
objmail.from="catalogs@mywebsite.com"
objmail.to= "catalogs@mywebsite.com"
objmail.Subject="Catalog DownLoad -- " & session("CustNumber")
objmail.HtmlBody= "Catalog dated 07/01/2008 was downloaded"
objmail.send
set objmail= Nothing
End Sub
respnonse.end
%>
golfdoctor
Tthanks for your intro to AJAX url
scrathcyboy:
Thank you very much for the time and effort you invested in helping me
I would gladly award you the points
But to do that I will have to click on "Accept as Solution" under your solution
I am not sure if that would be acceptable here........
Dory
golfDoctor
I thought you were looking for something a little more robust, and not just for a single file redirect. Accept which ever one helped you, if either.
dory550
ASKER
Scratchyboy
I decded to go with one of your solutions
Thank you
Dory
document.form1.submit();
form1 is the name of the form, and it submits to a server script whatever you want to be emailed to you.
Open in new window