erikjan Posted December 13, 2006 Share Posted December 13, 2006 Can someone please help? Thanks in advance!Is it possible with PHP to send a mail to someone when a certain webpage loads?For example: I have a webshop. A customer orderssome products, and has to fill in the the address etcto where the product has to be sent.Then he makes contact witn a bank; when thepayment is successfull, a page loads in whichthere is a notice that the transaction was OK.Is it possible to program with PHP, that when this page loadsa mail will be sent to the customer with the details of the transaction?Like in html: onLoad: do something.Or is the only possibility to have a form with submit etc... Link to comment https://forums.phpfreaks.com/topic/30520-onload-page/ Share on other sites More sharing options...
thedarkwinter Posted December 13, 2006 Share Posted December 13, 2006 HiI think if you POST the data to the page then you can just mail the detail before you output.So when the transaction is complete you redirect to the page which says something like:[code]<?php$to = $_POST["mailto"];$subj = "your transaction";$message = "blah blah blah";mail($to, $subj, $message);?><html>---> html output <---</html>[/code]does that help?cheers,tdw Link to comment https://forums.phpfreaks.com/topic/30520-onload-page/#findComment-140500 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.