日期:2014-05-17  浏览次数:20582 次

表单参数不能获取写入数据库
写入sql server 2000 数据库 字段为varchar  

edit.php代码如下:

<FORM id="myForm" METHOD="POST" ENCTYPE="multipart/form-data" ACTION="uploadedit.php?name=<? 
$user=$_GET['fcren'];echo $user ?>&time=<? echo $_GET[time]?>&kwm=<? echo $_GET[kwm]?>&kwm_id=<? echo $_GET[kwm_id]?>">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <td><TABLE BORDER=0 width = 100%>
  <tr>
  <td><span id="myAttaches"><a href="../km_select.php?kwmc=<? echo $_GET[kwm]?>&kwm_id=<? echo $_GET[kwm_id]?>"">返回上一级</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>
  <input id="filename3" name="filename" value="<?php $docfile = $_GET["filename"];echo $docfile; ?>" type="hidden"></td></tr>
  <tr>
  <td> <span id="myAttaches">
  <input id="htmlfile" name="htmlfile" value="<?php $htmlname = strrpos($docfile,".");if($htmlname){$htmlfile= substr($docfile,0,$htmlname).".html";}else{$htmlfile = $docfile.".html";};echo $htmlfile; ?>" type="hidden">
</span></td>
  </tr>
  <tr>
  <td>刊物名称:<? echo $_GET[kwm]?> 发布时间:
  <input name="time" type="text" id="time" value="<? $time=$_GET[time];echo $time ?>"> </td>
  </tr>
  <tr>
  <td>选择年度:
  <? include "niandu.php"?>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="../news/fanhui.php?kwmc=<? echo $_GET[kwmc]?>&kwm_id=<? echo $_GET[kwm_id]?>" >发出<? echo $_GET[kwm]?></a></td>
  </tr>

editupload.php代码如下:
<?php 
$niandu=$_POST['niandu'];
$kwm=$_GET['kwm'];
$wjm=$_POST['wjm'];
$htmladd=$_POST['htmlfile'];
$docadd=$_POST['filename'];
$fcren=$_GET['name'];
$fctime=$_POST['time'];
$kwm_id=$_GET['kwm_id'];

//定义数据库连接
include "connect.php";
$str="insert into kanwu (niandu,kwm,wjm,htmladd,docadd,fcren,fctime,bm,qx,kwm_id) values ('$niandu','$kwm','$wjm','$htmladd','$docadd','$fcren','$fctime','$bm','$qx','$kwm_id')";
mssql_query($str,$link);
?>

现在kwm和fcren字段写入数据库的值为“?”,其他表单字段都可以正常写入数据库字段,请大家帮忙看看

------解决方案--------------------
kwm和fcren字段的类型?
你的程序文件的编码?
------解决方案--------------------
form是POST提交,你是从哪得到这些GET值的??