This content has been marked as final. Show 3 replies
You should remove the final comma from the 'associateLead' array. Instead of this:
FirstName: <?php echo "'" . $theName . "'"; ?>,
It should be this:
FirstName: <?php echo "'" . $theName . "'"; ?>
Thanks for the response. However, it still doesn't work with removing the comma. I've tried several different variations of the code and can't get anything to work. My webhook endpoint is simply a PHP file in the root of my web server, and has public access. I can confirm the file works, as I'm able to print $theName and $theEmail to a file and they include the correct values. But for some reason the script doesn't seem to run or send any data.
Does it have anything to do with the fact that the user is not actually visiting the page where this code is run? The form sends the submission data over a webhook (HTTP callback) behind the scenes to this endpoint - which is on an entirely different server.
Where is the JS itself being executed? Are you retrieving that script via an XHR, and then executing it client-side? If so what has you testing shown? Is the associateLead GET being sent out of the browser? Could you provide an example of a call that comes out?