This topic is locked

Email a HTML form (with PHP embedded code) upon pressing button

8/23/2017 1:18:44 PM
PHPRunner General questions
K
karmacomposer author

I have created a HTML form with embedded PHP code that logs into the database and auto-fills in the form fields in the HTML form from a database I created with PHP Runner.
What I need to do is have an ADMIN only button in the PHP Runner Database that, when pressed, emails that record's data with the HTML form code I created.

How can I do this in PHPRunner and WHERE would I put the button?
I was thinking of putting the custom 'SEND PDA FORM' button in the EXPORT function or on a VIEW page at the bottom or top.
How do I format the HTML code with the embedded php code to work in a PHPRunner button?
Thank you.
Mike

admin 8/23/2017

This button can be added on any page you want, just make sure you only display it for admin user.
Then in your PHP code you need to create complete HTML code of your email message and send it using runner_mail() function.
The actual code depends on what page you adding this code to and how do you want to format the message.
Here is an example:

$message = "Dear ".$values["firstname"]."

Your invoice due date is: <b>".$values["invoicedate"]."</b>";