WebHook and PHP


I tried to implement WebHook and used PHP script to process form data.

  1. Here is an example of PHP script I tested to process data in JSON format

data = json\_decode(_POST[‘data.json’]);

Unfortunately, this test didn’t work. Any ideas what is wrong with the script above?

  1. This is an example of script to process other parameters


It works fine.


Hi Carl,
Thank you for the reply. I tried and tested your idea. Unfortunately, it didn’t help - still can’t process data posted in json format…


Hi Alex, sorry to hear that didn’t get it working for you. I’ve just tested this again, using a sample PHP script I’ve created, and I can tell you that it definitely works. Here’s the exact script I used (just add your own email address at the bottom).


Can you send your script to support@unbounce.com so we can have a look? Also, which version of PHP are you using?


Hi Alex, sorry for the late response. I think the issue is that PHP converts any dots in variable names to underscores, so simply changing your code to this:

data = json\_decode(_POST[‘data_json’]);

should fix it right up!

See here for more information:


I was reading a thread on PHP6, and there’s debate amongst the developers as to whether or not this behaviour makes sense. Here’s the discussion if you’re interested:


Hope that helps! Would love to hear more about how you’re using our webhook…


  • Carl