Category Archives: PHP

Facebook Webhook Integration Code in PHP

Many types of applications that interact with Facebook will need to use webhooks. Messenger chat bots are an example. If you follow Facebook’s setup guide, you’ll notice that the example provided to activate a webhook for the first time is in Node.js:   app.get('/webhook', function (req, res) {     if (req.query['hub.verify_token'] === 'YOUR_VERIFY_TOKEN') {       res.send(req.query['hub.challenge']);     } else […]

How To Make A POST Request with PHP and cURL

Below you’ll find the PHP code to make a simple POST request using cURL. You can send the POST request either to your own server/domain, or to an external one, though it’s not guaranteed the external host will accept your POST. <?php                 $name = "John Doe";                 $email = "";                 $url = "";                 $fields = "name=$name&email=$email"; […]