Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在$\u POST中的变量旁边插入静态内容_Php_Wordpress_Gravity Forms Plugin_Plivo - Fatal编程技术网

Php 如何在$\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,

如何在$\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, $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"]