gpt4 book ai didi

.net - 大字符串而在 POST 期间忽略空格后的字母

转载 作者:太空宇宙 更新时间:2023-11-03 20:24:23 24 4
gpt4 key购买 nike

我有一个 textarea,当我在 textarea 中发布该内容时,在给出空格之前我只得到第一个词。例如,如果我在 textarea 中的值为“他是个疯子”,我只会得到“他”。

请帮我解决这个问题;

代码:

<form name="SendSMS" method="post" action="admin_main.php">
<div class="reg_item">Category </div>
<div class="reg_item">
<select name="cat" class="reg_combo" class="tboxstyle">
<option value="car" class="tboxstyle">Carrer</option>
<option value="tho" class="tboxstyle">Thoughts</option>
<option value="jok" class="tboxstyle">Jokes</option>
<option value="hea" class="tboxstyle">Health</option>
</select>
</div><br />


<div class="reg_item">Message </div>
<div class="reg_item"><input type="text" name="message" class="tboxstyle"></input></div><br />



<?
if ( $_SERVER['REQUEST_METHOD'] == 'POST' )
{

$msms=new sms();
$msms->sendsms();


}

?>


<div class="reg_item"><input type="submit" name="register" value="Send >>" /></div>
</form>

功能:

function sendsms()
{
try
{

$cat =$_POST[cat];
$message =$_POST[message];
$link="http://www.aswinanand.com/sendsms.php?uid=9488446874&pwd=sivad&phone=9952880550&msg=dg";
$table="";

if($cat=="car")
{
$table=="carrer_memb";
}
elseif($cat=="tho")
{
$table=="thoughts_memb";
}
elseif($cat=="jok")
{
$table=="jokes_memb";
}
elseif($cat=="hea")
{
$table=="health_memb";
}



$result = mysql_query("SELECT mobile FROM carrer_memb");

while($row = mysql_fetch_array($result))
{
echo $message;
$link="http://www.aswinanand.com/sendsms.php?uid=9488486874&pwd=sivakasi&phone=".$row['mobile']."&msg=".$message;
$contents = file_get_contents($link);
echo $contents;
//header("Location: http://www.aswinanand.com/sendsms.php?uid=9488486874&pwd=sivakasi&phone=".$row['mobile']."&msg=".$message);


}



}
catch(Exception $e)
{
echo 'Caught exception: ', $e->getMessage(), "\n";
}
}








}

最佳答案

你必须申请urlencode链接字符串中所有值的函数:

$params = array(
'uid' =>urlencode($uid),
'pwd' =>urlencode($pwd),
'phone'=>urlencode($row['mobile']),
'msg' =>urlencode($message)
);
$link= 'http://www.aswinanand.com/sendsms.php?' . http_build_query($params)

附言更改您的密码,切勿在线发布您的用户名和密码

关于.net - 大字符串而在 POST 期间忽略空格后的字母,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1799009/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com