O'Reilly logo

Twilio Cookbook Second Edition by Roger Stringer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Letting a user purchase a custom phone number

Ok, once a user has signed up, he/she is going to need a phone number that he/she can call his/her own.

On signup, we forward the user to the /phone-number object, which is what we'll build in this recipe.

Getting ready

The complete source code for this recipe can be found in the Chapter9/Recipe3 folder in the source code for this book.

How to do it...

Our app will walk users through the process of searching for and purchasing a phone number using the following steps:

  1. Update the following index.php file:
    <?php include 'Services/Twilio.php'; require("config.php"); require("system/jolt.php"); require("system/pdo.class.php"); require("system/functions.php"); $_GET['route'] = isset($_GET['route']) ? '/'.$_GET['route'] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required