Php 如何在$\u POST中的变量旁边插入静态内容
如何在$\u POST变量前后插入静态短语?以下是我正在使用的代码:Php 如何在$\u POST中的变量旁边插入静态内容,php,wordpress,gravity-forms-plugin,plivo,Php,Wordpress,Gravity Forms Plugin,Plivo,如何在$\u POST变量前后插入静态短语?以下是我正在使用的代码: <?php require_once '/home/example/public_html/sms/vendor/autoload.php'; use Plivo\RestAPI; $auth_id = "MAM2IXMDVLNZI3xxxxxx"; $auth_token = "YmI0NmQyZWQ5MDcwNjEyNjc4ZTMxYjNhMmxxxxxx"; $p = new RestAPI($auth_id,
<?php
require_once '/home/example/public_html/sms/vendor/autoload.php';
use Plivo\RestAPI;
$auth_id = "MAM2IXMDVLNZI3xxxxxx";
$auth_token = "YmI0NmQyZWQ5MDcwNjEyNjc4ZTMxYjNhMmxxxxxx";
$p = new RestAPI($auth_id, $auth_token);
// Send a message
$params = array(
'src' => 'AcmeLLC', // Sender's phone number with country code
'dst' => $_POST["dst"], //Receiver's phone number with country code
'text' => $_POST["text"], // Your SMS text message
//'url' => 'http://example.com/sms.html', // The URL to which with the status of the message is sent
'method' => 'POST' // The method used to call the url
);
// Send message
$response = $p->send_message($params);
// Print the response
echo "Response : ";
print_r ($response['response']);
// Print the Api ID
echo "<br> Api ID : {$response['response']['api_id']} <br>";
// Print the Message UUID
echo "Message UUID : {$response['response']['message_uuid'][0]} <br>";
?>
正如你们所知,这显然是错误的,因为并没有任何提示表明某些单词是否是静态的,而另一些是通过POST从重力表单接收的。我该怎么做
谢谢 给你:
'text' => 'Hello'.$_POST["name"].'Thank you for registering. Your unique membership ID is'. $_POST["memid"] .'More details have been sent on'. $_POST["email"]
用单引号将文本括起来
如果可行,请告诉我。非常感谢!这真是太好了!我知道答案很简单,但作为一名PHP新手,这对我来说是一项巨大的成就@很高兴它帮助了你!请将答案标记为正确:)
'text' => 'Hello'.$_POST["name"].'Thank you for registering. Your unique membership ID is'. $_POST["memid"] .'More details have been sent on'. $_POST["email"]