Letting users subscribe to receive surveys
Before we can send surveys, we want to have a way for users to subscribe to them.
This form will let users enter their phone numbers and add them to the survey system.
You can put this page on a section of your website and allow people to sign up to receive your surveys.
Getting ready
The complete source code for this recipe can be found in the Chapter3/
folder of the code bundle available at http://www.packtpub.com/support.
How to do it...
Let's build a handy system to let users subscribe to receive our surveys. Perform the following steps:
Load the
sql.sql
file into your database.Upload
config.php
to your website and make sure the following variables are set:<?php $accountsid = ''; // YOUR TWILIO ACCOUNT SID $authtoken = ''; // YOUR TWILIO AUTH TOKEN $fromNumber = ''; // PHONE NUMBER CALLS WILL COME FROM $dbhost = ''; // YOUR DATABASE HOST $dbname = ''; // YOUR DATABASE NAME $dbuser = ''; // YOUR DATABASE USER $dbpass = ''; // YOUR...