写入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> </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"?>
<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字段写入数据库的值为“?”,其他表单字段都可以正常写入数据库字段,请大家帮忙看看
$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> </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"?>
<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字段写入数据库的值为“?”,其他表单字段都可以正常写入数据库字段,请大家帮忙看看
你的程序文件的编码?
<?
if ($_GET[pid]=="")
{
$pid=1;
}
else
{
$pid=$_GET[pid];
}
?>
<?
include "connect.php";
$cmd_xxwkjs="select id,niandu,kwm,wjm,htmladd,docadd,qx from xxkw where kwm='$kwms'";
$dataset=mssql_query($cmd_xxwkjs,$link);
$jks=0;
while ($rows=mssql_fetch_row($dataset)):
{
$jks++;
}
endwhile;
?>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr align="center" bgcolor="#CCCCCC">
<td width="10%" height="20">序号</td>
<td width="27%" height="20">年度</td>
<td width="36%" height="20">期号</td>
<td width="27%" height="20">管理</td>
</tr>
<?
include "connect.php";
$cmd_xxwk="select id,niandu,kwm,wjm,htmladd,docadd,fcren,fctime,bm,qx,px from xxkw where kwm='$kwms' order by niandu desc,px desc";
$datasetkw=mssql_query($cmd_xxwk,$link);
for($i=1;$i<=$jks;$i++)
{
list($kwid,$niandu,$kwm,$wjm,$htmladd,$docadd,$fcren,$fctime,$bm,$qx,$px)=mssql_fetch_row($datasetkw);
if($i>=($pid-1)*15+1 and $i<=$pid*15)
{
?> <tr>
<td height="20" align="center" bgcolor="#FFFFFF"><? echo $i?></td>
<td height="20" bgcolor="#FFFFFF"> <? echo $niandu?></td>
<td height="20" bgcolor="#FFFFFF"> <? echo $wjm?></td>
<td height="20" align="center" bgcolor="#FFFFFF"><a href="modify.php?id=<? echo $kwid?>&niandu=<? echo $niandu?>&kwm=<? echo $kwm?>&wjm=<? echo $wjm?>&htmladd=<? echo $htmladd?>&docadd=<? echo $docadd?>&fcren=<? echo $fcren?>&fctime=<? echo $fctime?>&bm=<? echo $bm?>&qx=<? echo $qx?>&px=<? echo $px?>&op=1&kwm_id=<? echo $_GET[kwm_id]?>">管理</a></td>
</tr>
<?
}
}
?>
</table>
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>刊物管理</title>
</head><body>
<p>文件发出成功</p>
<p><a href="km.php?kwmc=<? echo $_GET[kwmc]?>&kwm_id=<? echo $_GET[kwm_id]?>">返回</a></p>
<p> </p>
</body>
</html>
你有
$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);加上
echo base64_encode($str);
贴出结果
结果 csdn限制回复中存在非法字符不能提交echo $str只能获取到kwm_id的值
只要 echo base64_encode($str); 的结果,别的不要
注意:一定要那出问题时的
==
你这个什么都没有,贴了有什么用?