php 中select传值问题,求救!
前一页:说:<label><inputname="chatinfo"type="text"size="40"onkeypress="inputkeypress();"/>...
前一页:
说:
<label>
<input name="chatinfo" type="text" size="40" onkeypress="inputkeypress();"/>
</label>
<p>表情:
<label>
<select name="select1" size="1">
<option>哭</option>
<option>笑</option>
</select>
</label>
动作:
<label>
<select name="select2" size="1">
<option>打</option>
<option>骂</option>
</select>
</label>
</p>
<p>
<label>
<input type="submit" name="Submit" value="发送" />
处理的页:
$namef=$_POST['namefrom'];
$nameto=$_POST['nameto'];
$chatinfo=$_POST['chatinfo'];
$bq=$_POST['select1'];
$dz=$_POST['select2'];
$l_time=date('Y-m-d H:i:s');
$_tosay= $namef."对".$nameto."说:".$chatinfo."表情:".$bq."动作:".$dz."时间是: ".$l_time;
include("conn.php");
$query1 = "insert into chatcont (cont) values ('$_tosay')";
$query2 = "insert into userinfo (name,lastchattime) values ('$namef','$l_time')";
$result1 = mysql_query($query1) or die ("Error in query: $query1. ".mysql_error());
$result2 = mysql_query($query2) or die ("Error in query: $query2. ".mysql_error());
插入成功了,可是结果是:表情的值是动作的值,动作没值
例如这个结果:
66对33说:11表情:骂动作:时间是: 2008-11-16 15:14:16
请问是啥原因?先谢了 展开
说:
<label>
<input name="chatinfo" type="text" size="40" onkeypress="inputkeypress();"/>
</label>
<p>表情:
<label>
<select name="select1" size="1">
<option>哭</option>
<option>笑</option>
</select>
</label>
动作:
<label>
<select name="select2" size="1">
<option>打</option>
<option>骂</option>
</select>
</label>
</p>
<p>
<label>
<input type="submit" name="Submit" value="发送" />
处理的页:
$namef=$_POST['namefrom'];
$nameto=$_POST['nameto'];
$chatinfo=$_POST['chatinfo'];
$bq=$_POST['select1'];
$dz=$_POST['select2'];
$l_time=date('Y-m-d H:i:s');
$_tosay= $namef."对".$nameto."说:".$chatinfo."表情:".$bq."动作:".$dz."时间是: ".$l_time;
include("conn.php");
$query1 = "insert into chatcont (cont) values ('$_tosay')";
$query2 = "insert into userinfo (name,lastchattime) values ('$namef','$l_time')";
$result1 = mysql_query($query1) or die ("Error in query: $query1. ".mysql_error());
$result2 = mysql_query($query2) or die ("Error in query: $query2. ".mysql_error());
插入成功了,可是结果是:表情的值是动作的值,动作没值
例如这个结果:
66对33说:11表情:骂动作:时间是: 2008-11-16 15:14:16
请问是啥原因?先谢了 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询