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条)

报告相同问题?

悬赏问题

  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?
  • ¥15 关于#vue.js#的问题:修改用户信息功能图片无法回显,数据库中只存了一张图片(相关搜索:字符串)
  • ¥15 texstudio的问题,