이것은 내가 가지고있는 코드입니다. 어쩌면 나는 거대한 오류가있을 수 있습니다. 그러나 API ID, 메시지 ID 및 보낸 사람을 자체 목록 아래에 데이터베이스에 넣습니다. 그러나 이제는 내가하는 일에 상관없이 메시지 텍스트의 콜백을 넣을 수는 없습니다. 그것은 나타나지 않는 것 같아요 그리고 나는 그걸 알아 내려고 잘못 가고있는 것이 궁금합니다.Clickatell 하프 작업으로 메시지를 가져 오려고 시도
대단히 감사합니다. Maurissa
<?php
//database connection
$hostname_sCONN = "localhost";
$database_sCONN = "XXXXXX";
$username_sCONN = "XXXXX";
$password_sCONN = "XXXXXX";
$sCONN = mysql_pconnect($hostname_sCONN, $username_sCONN, $password_sCONN) or trigger_error(mysql_error(),E_USER_ERROR);
// Declare variables for url string
//http://www.mysite.com/callback.php?api_id=xxx&apiMsgId=xxx&cliMsgId=xxx&status=xxx×tamp=xxx&to=xxx&from=xxx&charge=xxx
//this will pull the query part of the url i.e. api_id=xxx&apiMsgId=xxx&cliMsgId=xxx&status=xxx×tamp=xxx&to=xxx&from=xxx&charge=xxx
$url = $_SERVER['QUERY_STRING'];
//retrieve contents of the url
$api_id = $_GET['api_id'];
$from = $_GET['from'];
$to = $_GET['to'];
$text = $_GET['text'];
$dated = $_GET['timestamp'];
$apiMsgId = trim($_GET['apiMsgId']);
$status = $_GET['status'];
$charge = $_GET['charge'];
mysql_select_db($database_sCONN, $sCONN);
$sql = "INSERT INTO tbl_messages (msgid, apiMsgId, sender, recipient, dated, message) VALUES ('$api_id', '$apiMsgId', '$from', '$to', '$dated', '$text')";
$result = mysql_query($sql, $sCONN) or die(mysql_error());
mysql_free_result($rsOutbox);
mysql_select_db($database_sCONN, $sCONN);
$sql2 = "SELECT value1 FROM fgusers3 WHERE mobile = '".$from."'";
$result2 = mysql_query($sql2, $sCONN) or die(mysql_error());
mysql_free_result($rsOutbox);
$query4 = "SELECT * FROM `$user` ORDER BY id_user DESC
LIMIT 1";
$result4 = mysql_query($query4);
$row4 = mysql_fetch_array($result4);
$balance = $row4['balance'];
$finalbalance = $result2 + $balance;
$sql3 = "INSERT INTO `$user` (`date`, `credit`, `balance`) VALUES ('$today', '$result2', '$finalbalance')";
$result3 = mysql_query($sql, $sCONN) or die(mysql_error());
?>
붙여 넣은 코드는 Clickatell API (HTTP/S, SMPP/SMTP/FTP/XAML/SOAP 또는 COM)와는 아무런 관련이 없습니다. – Baba
Clickatell API HTTP 콜백 스크립트이므로 Clickatell API와 관련이 있습니다. – user1295716
좋아 .. 그래서 뭐냐고 주요 도전 .. 응답을 검색하거나 mysql에 응답을 저장 ??? 당신이 이슈를 가지고있는 곳이 정말로 명확하지 않기 때문에 이것을 묻는 중입니까 ??? – Baba