Change the form code to update a CRM...

User 2881809 Photo


Registered User
4 posts

Hi everyone, I intend to have all my forms working on my on PHP Server and I will insert a code into them
to update my CRM. I would like your help by telling me where is the better place to put this code inside the form created by the Coffeecup, please?

The code is a CUL function like this:

$emailId="xx@xxxxx.com.br";
$PASSWORD="xxxxxxxx";
#echo "NAME=".$_REQUEST['NAME']."&EMAIL_WORK=".$_REQUEST['EMAIL_WORK']."&PHONE_WORK=".$_REQUEST['PHONE_WORK']." &ADDRESS=".$_REQUEST['ADDRESS']."&TITLE=New lead from Website&SOURCE_ID=WEB&ASSIGNED_BY_ID=1&LOGIN=".$emailId."&PASSWORD=".$PASSWORD;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://mydomain.crm.com/crm/configs/import/lead.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
"NAME=".$_REQUEST['NAME']."&EMAIL_WORK=".$_REQUEST['EMAIL_WORK']."&PHONE_WORK=".$_REQUEST['PHONE_WORK']." &ADDRESS=".$_REQUEST['ADDRESS']."&TITLE=New lead from Website&SOURCE_ID=WEB&ASSIGNED_BY_ID=1&LOGIN=".$emailId."&PASSWORD=".$PASSWORD);

// receive server response ...
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result =curl_setopt ($ch, CURLOPT_CAINFO, "cacert.pem");
$server_output = curl_exec ($ch);
#echo "Result=".curl_error($ch);
curl_close ($ch);
#exit();
Carlos Eduardo de Lima
doeduardolima@gmail.com
User 10077 Photo


Senior Advisor
1,095 posts

When a form is submitted, if I'm not mistaken, the data is saved in a SESSION. From the "thanks" page, you can capture that data and insert it into your CRM. Using this method, you don't have to try to alter the code of the form, and it should be much easier.
ASK ME ANYTHING
I provide personalized help for Coffeecup Users including personal or group training for Site Designer, Web Form Builder and more via Zoom.
Email me at support@uscni.org or call 865-687-7698.

Did you know that Web Form Builder can be used for both simple and complicated forms and that it's not limited to the default fonts and buttons? Take a look at a form we developed for WindowTinting.com.
https://forms.windowtinting.com/forms/w … ppingcart/
User 187934 Photo


Senior Advisor
20,188 posts

As Brian stated the variables are stored in a $_SESSION. I just posted an example.
Try this method.
http://www.coffeecup.com/forums/web-for … post274741
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.