close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

How to include database data within the e-mail receipt AND carry over form data?

Thread began 8/27/2015 4:49 am by Nathon Jones Web Design | Last modified 8/31/2015 3:18 pm by Nathon Jones Web Design | 799 views | 7 replies

Nathon Jones Web Design

How to include database data within the e-mail receipt AND carry over form data?

I'm using the WebAssist > Create Email Message behaviour to send an e-mail to the customer on completion of an UPDATE form.

The UPDATE form simply changes one of the product's values in the product table whereas the rest of the form is the customers contact details.

I am carrying over product data in the redirect section of the UPDATE behaviour to my confirmation page (on which Universal Email resides) as follows:

$UpdateGoTo = "reserve-whisky-cask-confirm.php?wbid=".($rsCASKINFO->getColumnVal("wbprodID"))  ."&cask=".($rsCASKINFO->getColumnVal("wbprodTITLE"))  ."&caskno=".($rsCASKINFO->getColumnVal("wbprodCASKNO"))  ."&caskprice=".($rsCASKINFO->getColumnVal("wbprodPRICE"))  ."";



What I'd like to do is just carry over the product ID so that I can create a recordset on the confirmation page AND include data from that recordset in the Universal Email email that's sent out. I'm using a separate file, reservecaskreceipt.php, as the template for the Universal Email body.

I can create the recordset on the confirmation page but when I include database data in reservecaskreceipt.php I get the following error:

Notice: Undefined variable: rsCASKINFO in /home/linweb39/n/nathonjoneswebdesign.co.uk/user/htdocs/whiskybroker/reservecaskreceipt.php on line 18

Fatal error: Call to a member function getColumnVal() on a non-object in /home/linweb39/n/nathonjoneswebdesign.co.uk/user/htdocs/whiskybroker/reservecaskreceipt.php on line 18



So I assumed that I'd need to include the database connection script and recordset on the reservecaskreceipt.php page too:

<?php require_once('Connections/csdbmysqli.php'); ?>
<?php require_once('webassist/mysqli/rsobj.php'); ?>
<?php
$rsCASKINFO = new WA_MySQLi_RS("rsCASKINFO",$csdbmysqli,1);
$rsCASKINFO->setQuery("SELECT wbprodID, wbprodTITLE, wbprodPRICE, wbprodCASKNO FROM WBproducts WHERE wbprodID = ?");
$rsCASKINFO->bindParam("i", "".(isset($_GET['wbid'])?$_GET['wbid']:"") ."", "-1"); //WAQB_Param1
$rsCASKINFO->execute();
?>



However this then produces the following error:

Notice: Undefined variable: csdbmysqli in /home/linweb39/n/nathonjoneswebdesign.co.uk/user/htdocs/whiskybroker/reservecaskreceipt.php on line 4

Fatal error: Call to a member function Prepare() on a non-object in /home/linweb39/n/nathonjoneswebdesign.co.uk/user/htdocs/whiskybroker/webassist/mysqli/rsobj.php on line 155



...and I reach a dead end on this part of it. :(

However, I also need to carry over the remaining form data - the customers contact information - so that it's included in the Universal Email body and had the following within my reservecaskreceipt.php template page:

<?php echo((isset($_POST["resvcaskNAME"]))?$_POST["resvcaskNAME"]:"") ?>
<?php echo((isset($_POST["resvcaskNAME"]))?$_POST["resvcaskPHONE"]:"") ?>
<?php echo((isset($_POST["resvcaskNAME"]))?$_POST["resvcaskEMAIL"]:"") ?>



...etc.

But these values do not appear to be carried over from the UPDATE form. If it's just a standard form-to-email then it works but I'm assuming that it doens't because I'm using an UPDATE form and in the process of doing the UPDATE it wipes the form values?

...again I reach a dead end.

How do I include recordset data AND the submitted form data on my reservecaskreceipt.php template page?
Much appreciated.
NJ

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...