Building a survey tree
The survey builder performs three functions: it shows you the stats on sent surveys, lets you send unsent surveys, and lets you build your new surveys.
Surveys in this system are simple: one question and six possible answers.
Each answer will be assigned a number of 1 to 6.
Getting ready
The complete source code for this recipe can be found in the Chapter3/
folder.
How to do it...
We've got subscribers but we need to send them what they've subscribed to. This recipe will set up our survey builder. We'll also build a home page as part of our builder, where we can choose to send surveys or view results.
Download the Twilio Helper Library from https://github.com/twilio/twilio-php/zipball/master and unzip the file.
Upload the
Services/
folder to your website.Create a file on your website and name it
survey-builder.php
. The file will have the following content:<?php include("config.php"); include("pdo.class.php"); include 'Services/Twilio.php'; switch($_GET['action'] ){ case...