dongou6632 2016-04-19 03:45
浏览 53
已采纳

我需要帮助PHP发送表单发送多行

i have an api of sms

<?php

// Configuration variables

$type = "xml";

$id = "92300xxxxxxx";

$pass = "xxxxxxxxxxxx";

$lang = "English";

$mask = "Outreach";

// Data for text message

$to = "$_POST['to']";

$message = "$_POST['message']";


// Prepare data for POST request

$data = "id=".$id."&pass=".$pass."&msg=".$message."&to=".$to."&lang=".$lang."&mask=".$mask."&type=".$type;

// Send the POST request with cURL

$ch = curl_init('http://www.outreach.pk/api/sendsms.php/sendsms/url'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch); //This is the result from Outreach curl_close($ch);

?>

now i make a form

<form method="post">
<input type="text" name="message">
<input type="text" name="to">  --->contact number list 
</form>

now i want to send sms to multiple numbers with this i can send to one number at one time can anyone help me in this matter

  • 写回答

2条回答 默认 最新

  • dongsashe6006 2016-04-30 06:58
    关注

    i have solved the issue

    $numb = $_POST['to'] $tos = preg_replace('#\s+#',',',trim($numb)); with this line ^_^

    $to = "$tos";

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程