Forums

Difficulty with ChronoForms

erickmilan 25 Feb, 2011
I'm having trouble setting the ChonoForms. What happens is this, I configured Chronoforms to send an email to the user after he post their data via the form. Data sent via the POST form is ok, works well and appears in the message sent, the problem is that I want to get a table item which data was not posted by the user, if I send the cf_id which is an auto increment number (red in the code). I tried using the command line, in red, but nothing happens. I wonder if anyone knows how to get this data in the table and what code to use to send the email message to the user?

The code below I put in step 4 FormWizard. It works when the user clicks to send data, it receives an email with the information he posted (After Submit Text).

<?php
$recipient = $_POST['email'];
$html_message = '<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8959-1" />
<style type="text/css">
p { font-family: Verdana, Arial, Helvetica, sans-serif; }
.ass { font-weight:bold; color:#2ac3d4; }
.obs { font-size:10px; }
</style>
</head>
<body>
<p>Hello <strong>'.$_POST["name"].'</strong>,</p>
<p>We have received your registration successfully!.</p>
<p>This is a summary of your confirmation:</p>
<p>You number: <strong>'.$row->cf_id.'</strong></p>
<p>Name: <strong>'.$_POST["name"].'</strong></p>
<p>RG: <strong>'.$_POST["rg"].'</strong></p>
<p>Email: <strong>'.$_POST["email"].'</strong></p>

</body>
</html>';
mosMail($from, $fromname, $recipient, $subject, $html_message, true );

echo '<div style="width:700px; text-align:center;">
<h3 style="margin:20% 0;">Message sent successfully!<br>
</h3>
</div>';
echo "<meta http-equiv='refresh' content='3;URL=index.php'>";
?>


Thank you all!
GreyHead 26 Feb, 2011
Hi erickmilan,

I think that we’ve looked at this before and found that the work-flow that ChronoForms uses makes it impossible to get the record id into an email. The value substitution in the email always takes place before the DB Connection executes (this is true even if the email is sent after the DB Connection).

The work-around that I use is to use a random string as a transaction identifer. I can generate this in the OnSubmit Before Email box and have it included both in the email and in the saved record.

The down-side is that it's a bit more work; the upside is that a random string is more secure than a serial id and prevents users 'guessing' what other ids might be valid.

Bob



Bob
erickmilan 26 Feb, 2011
Thanks Grey

I'll try to use other means to send a number to the user.

Hug and success.
This topic is locked and no more replies can be posted.