Skip to content

Instantly share code, notes, and snippets.

@twilioforkwc
Created September 22, 2015 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twilioforkwc/e2fb091e234c99a0a551 to your computer and use it in GitHub Desktop.
Save twilioforkwc/e2fb091e234c99a0a551 to your computer and use it in GitHub Desktop.
<?php
require '../Services/Twilio.php';
// Connect to MySQL, and connect to the Database
mysql_connect('[ServerURL]', '[ID]', '[PWD]') or die(mysql_error());
mysql_select_db('[DB]') or die(mysql_error());
$pollDigits = $_REQUEST['Digits'];
$sql_telNo = mysql_query("SELECT * FROM poll");
$sql_str="INSERT INTO summitpoll_an(select_digits) VALUES ('$pollDigits')";
$say_str="番の作品を選択しました。ありがとうございました。";
switch ($pollDigits) {
case 1:
$sql = $sql_str;
mysql_query($sql);
$say = $pollDigits.$say_str;
break;
case 2:
$sql = $sql_str;
mysql_query($sql);
$say = $pollDigits.$say_str;
break;
case 3:
$sql = $sql_str;
mysql_query($sql);
$say = $pollDigits.$say_str;
break;
case 4:
$sql = $sql_str;
mysql_query($sql);
$say = $pollDigits.$say_str;
break;
case 5:
$sql = $sql_str;
mysql_query($sql);
$say = $pollDigits.$say_str;
break;
case 6:
$sql = $sql_str;
mysql_query($sql);
$say = $pollDigits.$say_str;
break;
default:
$say = '投票可能な番号は1から6までです。番号を確認してください。';
break;
}
$response = new Services_Twilio_Twiml();
$response->say($say, array('language' => 'ja-jp'));
$response->hangup();
header("Content-type: text/xml");
print $response;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment