Scheduling reminders via text
This reminder system will let us send a text and get a reminder an hour before it's scheduled.
First, we have to set up the code to actually receive reminders.
Getting ready
The complete source code for this recipe can be found in the Chapter7/Recipe1
folder
How to do it…
To start with, we're going to build a method to schedule reminders via text messages. We'll build a web app that will let us send a message with a time and save the reminder for later.
Download Twilio Helper Library from https://github.com/twilio/twilio-php/zipball/master and unzip it.
Upload the
Services/
folder to your website.Upload
sql.sql
to your database.Upload
config.php
to your website and make sure the following variables are set:<?php session_start(); $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 = ...