Jump to content

OnLoad page


erikjan

Recommended Posts

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 orders
some products, and has to fill in the the address etc
to where the product has to be sent.

Then he makes contact witn a bank; when the
payment is successfull, a page loads in which
there is a notice that the transaction was OK.

Is it possible to program with PHP, that when this page loads
a 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

Hi

I 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.