<?php
if (isset($_POST['submit']))
{
$send_to = $_POST['number'];
$message = $_POST['message'];
echo $message;
$url ="http://assssdewweas.com/Send.aspx?userid=xxxxxx&password=xxxxxx&clientid=3589&senderid=asdodas&asdr=91send_to&smsmessage=$message";
$url = str_replace("\n","%0A",$url);
$url = str_replace(' ','+',$url);
echo $url;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$curl_scraped_page = curl_exec($ch);
curl_close($ch);
echo $curl_scraped_page;
}
?>
它工作正常,但问题是每当我在$message
变量中传递值时它都会回显:
http ://assssdewweas.com/Send.aspx?userid=xxxxxx&password=xxxxxx&clientid=3589&senderid=asdodas&asdr=91send_to&smsmessage= $message
代替:
hhttp://assssdewweas.com/Send.aspx?userid=xxxxxx&password=xxxxxx&clientid=3589&senderid=asdodas&asdr=91send_to&smsmessage=$message
我不希望hello
和之间有任何空格%0A
。请帮助如何解决它。