Skip to content

Instantly share code, notes, and snippets.

@maclover7
Created January 31, 2014 20:46
Show Gist options
  • Save maclover7/8742788 to your computer and use it in GitHub Desktop.
Save maclover7/8742788 to your computer and use it in GitHub Desktop.
twilio probs
<?php
include('Services/Twilio.php');
function guide(){
$response = new Services_Twilio_Twiml();
$response->sms("Blah.");
echo $response;
}
$body = $_REQUEST['Body'];
$result = preg_replace("/[^A-Za-z0-9]/u", " ", $body);
$result = trim($result);
$result = strtolower($result);
switch ($result) {
case 'hi’':
guide();
break;
default:
index();
}
@alyssais
Copy link

Okay, what's going wrong?

@maclover7
Copy link
Author

Twilio is showing a 500 error, other than that, not sure.

@alyssais
Copy link

Have you tried making the request yourself?

@maclover7
Copy link
Author

Yeah, I've texted in many times. It's saying that there's no response.

@maclover7
Copy link
Author

@alyssais
Copy link

What's the response code when you test it?

@maclover7
Copy link
Author

500

@maclover7
Copy link
Author

Nothing gets texted back

@alyssais
Copy link

That's weird.

@alyssais
Copy link

Try commenting it all out and re-enabling parts until you get a 200.

@maclover7
Copy link
Author

Gotcha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment