Hello everybody,

for my application I want to implement a email-clickcounter, next to link-clickcounter. Most links and emails (mailto:) appear on a page that gives details about a search-result from my home-made searchmodule. I have set up the counting system like this :
Every link is redirected to a click.php-file. In the redirecting url I have appended an id, a reference and a target :
- The id tells the script which id in the mysqli-table needs to be updated.
- The reference tells the script which table to use to update .
- The target is the url that I use in the header("Location:...)-function to redirect.

This works for the links, but not for the email-adresses I'd like to send. The click gets registrated, but the email form is not opened. I know the header()-function is not the right way, but I don't know what IS the right way.
Can somebody help me out on this ?
Thanks, much appreciated ...

Recommended Answers

All 2 Replies

My guess is that what you are trying is just not possible, because you can't redirect from a server (where the PHP script is) to a workstation ( where the email client is). You should probably replace the "mailto:" idea with a little form to capture the subject and message, and then you can write a script to send the email and update your database.

Thank you for the reply, NettSite !
I'm still working on 'localhost' for the moment, and I think I made a mistake in my code, the other day. Now it is possible to redirect and than open the email.
If the code is not working on a live server, I'll use the solution you just brought up.
Thanks for the tip, It is much appreciated !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.