
I created an internal website at work a couple years ago, using WFB 1.2 - It's working great so far. Once the user inputs their data, it submits it to a MySQL database, and then I have a few pages that display the various tables. Once the data is submitted, the database assigns the row ID, and we use this ID to track each form submission in our department. One of the things I'm continually asked to do is to include the database row ID in the subject line of the form auto-response email. I've been trying to figure this out for the past couple of days and am just not having any luck.
The closest I've come is to manually modify the form.cfg.php file, to query the database for the latest row #. The query I have works fine, and will return the correct # when I manually view this PHP file in the browser. When I try to pass that variable to the Subject line of the email however, the form errors out.
Maybe this cant be done, maybe I'm just totally looking at it wrong, I dont know. Does anyone have any ideas? Below is the pertainent portion of the form.cfg.php file I've modified:
<?php
$username = "-----";
$password = "-----";
$hostname = "localhost";
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
mysql_select_db('engineering');
$highest_id = mysql_result(mysql_query("SELECT MAX(_rowid_) FROM engineeringrequest_test"), 0);
echo $highest_id;
?>
{
"settings":
{
"data_settings" :
{
-------------
"auto_response_message" :
{
"custom" :
{
---
"subject" : "<?php echo $highest_id; ?>" <----------This is where I'm trying to pass the variable off to. Viewing this file manually it outputs the correct value, but the form doesnt like it.
Thanks!