am trying to put a button in the email created with php so that when the user gets that email, they can click the button to delete a record in the database directly without leaving the email client or email window they are in. is it possible and how do i achieve that? Thanks.
Asked
Active
Viewed 77 times
-1
-
1Nope its not possible – Hanky Panky Jun 16 '16 at 15:05
-
You may send a link (a URL) with the message, when the user clicks it, it will call your script which will delete or do any other thing. – Jose Manuel Abarca Rodríguez Jun 16 '16 at 15:06
-
@JoseManuelAbarcaRodríguez: which then fires up a browser and "leaves" the mail client. What OP wants is not possible – Marc B Jun 16 '16 at 15:07
-
@MarcB that page may attempt to close itself afterwards. Could that suffice for OP? – John Dvorak Jun 16 '16 at 15:08
2 Answers
2
The closest you can get I think is putting in a hyperlink to a web page which will automatically trigger the deletion when given the correct parameters. But it will still launch a web browser (and then a server-side script must run to do the deletion or whatever). And therefore you'll probably want to provide some feedback to the user on that page as well.

ADyson
- 57,178
- 14
- 51
- 63
-
-
-
We need to actually solve the underlying problem rather than proposing something else that would work. – Keral Patel Jun 29 '20 at 19:50
-
@KeralPatel nice try, but this particular problem is not actually solvable in the way the OP would have liked. Hence "the closest you can get..." in the answer. A workaround is appropriate when the desired solution is genuinely not achievable. P.S. Did you seriously go and trawl my answers from 4 years ago just to try and make a point in riposte to my comments on your [own answer](https://stackoverflow.com/questions/62644025/include-file-outside-from-public-html/62645390#62645390)? Maybe if you spend more time you'll manage to find one where you can actually catch me out :-) – ADyson Jun 29 '20 at 19:56
-
hehehe feels good to know the real reason. Thank you for elaborating on it. – Keral Patel Jun 29 '20 at 19:59
1
No, this is not possible. At best your email will contain a link that will spawn a new window or tab that will access a page to delete the record.

j08691
- 204,283
- 31
- 260
- 272