2

So this is what's on the top of the PHP file:

<?php
    // Start the session
    session_start();
?>

<?php
    // Get the PHP helper library from twilio.com/docs/php/install
    require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

    // Your Account Sid and Auth Token from twilio.com/user/account
    $sid = "ACXXXXXXXXXXXXXX"; 
    $token = "XXXXXXXXXXXXXXXXXX"; 
    $client = new Services_Twilio($sid, $token);

    $client->account->messages->sendMessage("+1234567890", "+0987654321", "Please?! I love you <3, Twilio Test");
?>

<?php
    // Start the session
    session_destroy();
?>

Then I have the <html> beneath.

The Issue I'm having is that the page just loads a white blank page and when I check the Twilio Log to see if any SMS are logged.

But the page loads just fine without the middle PHP (the part that's supposed to send the SMS through Twilio)

The Log is completely empty and shows no record of any outgoing SMS.

Any help would be appreciated!

jKIM
  • 155
  • 7

1 Answers1

0

Where are you getting sendMessage from? According to Docs this is how it is done

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "AC8ed2351ef2156d21a66faf913443188c"; 
$token = "{{ auth_token }}"; 
$client = new Services_Twilio($sid, $token);

$sms = $client->account->sms_messages->create("+14158141829", "+14159352345", "Jenny please?! I love you <3", array());
echo $sms->sid;
ecorvo
  • 3,559
  • 4
  • 24
  • 35