One 'onclick' for two events/actions.
I have an image on my productspage.php that when clicked presents a WinZip.exe file for the user to run or save.
I also want that same click to send me an email , unknown to the person downloading the file, that tells me "Product X Downloaded"
I do not need the senders email details!
I have tried to find a solution though googling but can find nothing.
I have a php script that sends me such an email when the page is opened but cannot see how to combine this with the download action.
Can this be done and if so how?
$email = $_POST['email'];
mail( "firstname.lastname@example.org", "product X free package", "product X free package page opened", "From: $email" );
print "THANK YOU FOR DOWNLOADING</br>";?>
Here is what I recommend:
1. Make link point to another page (saying your download will be starting shortly). This can be done with JS as well.
2. Top of the page have the mail function
3. then redirect to the winrar.exe download file using Header
That put me on the right track to get an aknowledgement of intent to download.
Pity it requires two clicks instead of one - but it works.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread