提取值的帖子失败 [英] post of fetched value fails

查看:53
本文介绍了提取值的帖子失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MySql数据库,我在其中搜索值以填充选项

框,如下所示:


< select size =" 1 QUOT; name =" customer">

< option selected =" selected">(not queried)< / option>

<?php while( $ nt = mysql_fetch_array($ result2)){

echo"< option value = $ nt [customer]> $ nt [customer]< / option> \\\
" ;;}

?>

< / select>


这样工作正常,所有客户都显示其全名,

包括空格(如果有)。


当我提交包含这部分代码的php页面时,在

这个页面我做了一个


$ customer = $ _ POST [''customer''];


然后$ customer的值被削减到第一个<空白(空格)

遇到。


E,g,:如果在选择框中显示客户名称John Smith,

然后我在提交后进入结果页面作为客户=约翰


当我做一个选择框时,具有固定的填充值(所以值不是

F从db中蚀刻)然后在提交后,我得到正确的信息

(值不会被切割到第一个空格)。


有没有人出来那可以为这个奇怪的行为提供解决方案吗?非常感谢!

I have a MySql db, in which I search for values to populate a selection
box, as follows :

<select size="1" name="customer">
<option selected="selected">(not queried)</option>
<?php while($nt=mysql_fetch_array($result2)){
echo "<option value=$nt[customer]>$nt[customer]</option>\n";}
?>
</select>

This works fine, all the customers appear with their complete names,
including spaces if there are.

When I do a submit of the php page containing this part of code and in
this page I do a

$customer=$_POST[''customer''];

then the value of $customer is cutted to the first <blank(space)
encountered.

E,g, : if in the selection box the customer name John Smith appears,
then I get in the result page after the submission as customer=John

When I make a selection box, with fixed populated values (so values not
fetched from the db) then after the submission, I get the correct info
(values are not cutted to the first space).

Is there anybody out there that can give a solution for this strange
(to me) behaviour ? It would be uttermost appreciated !

推荐答案

nt = mysql_fetch_array(
nt=mysql_fetch_array(


result2)){

echo"< option value =
result2)){
echo "<option value=


nt [customer]>
nt[customer]>


这篇关于提取值的帖子失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆