这样写对吗? 问题如下:Warning: Cannot add header information - headers already sent by (output started at D:\www\test_o.php:1) in D:\www\test_o.php on line 7 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 信息头已经送出了。Header("Location: ./index.htm"); exit;可以去掉exit; 说明你前面的$conn=ocilogon("scott","tiger","system"); if (($id!="") and ($content!="")) {$query="INSERT into sms_yy(id,content,length,author,sendtime,comments) values('$id', '$content', '$length', '$author', '$sendtime', '$comments')";不起作用只要echo$query是否有值再作决定 <?phpif ($id!="") { putenv("ORACLE_SID=oracle"); putenv("NLS_LANG=american_taiwan.zht16big5"); $handle=ora_logon("system","tiger") or die; $cursor=ora_open($handle); ora_commitoff($handle); $query="INSERT into sms_yy(id,content,author,comment) values('$id', '$content', '$author', '$comment' )"; ora_parse($cursor, $query) or die; ora_exec($cursor); ora_close($cursor); ora_logoff($handle); Header("Location: addmsg.php"); exit;} else {?><html><head><title>成功写入</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><body bgcolor="#FFFFFF" text="#000000"><table width="80%" border="0" cellspacing="0" cellpadding="0" height="58"> <tr bgcolor="#0066FF" bordercolor="#FFFFFF"> <td width="21%" height="2"> <div align="center"><font color="#FFFFFF">短语代码</font></div> </td> <td width="25%" height="2"> <div align="center"><font color="#FFFFFF">内容</font></div> </td> <td width="27%" height="2"> <div align="center"><font color="#FFFFFF">短语作者</font></div> </td> <td width="27%" height="2"> <div align="center"><font color="#FFFFFF">备注</font></div> </td> </tr> <tr> <td height="15" width="21%"> <div align="center"><?="$id"?></div> </td> <td height="15" width="25%"> <div align="center"> <?="$content"?></div> </td> <td height="15" width="27%"> <div align="center"><?="$author"?></div> </td> <td height="15" width="27%"> <div align="center"><?="$comments"?></div> </td> </tr></table></body></html><?php}?>错误如下:Warning: Oracle: Connection Failed: ORA-12560: TNS:协议适配器错误 in D:\www\xxx\add.php on line 7 在中图片植入代码 一个搜索的值 不用javascript 如何用图片实现流量统计 用adodb类作数据库连接,支持多类型数据库(oracle和mysql)帮忙讨论 来者有分 为什么我去不擀换行符? 这个无刷新页面怎么做的,请高手指点 急急!!请教文本显示问题 请问:怎样实现HTTP_REFERER的伪造? 奇怪,这是什么意思?? 用PHP怎样来识别输入框的汉字是BIG5码还是GB码?请赐教! 怎样在多处数据库连接时安全的从一个来源得到用户名和密码? 谁能给我一个最简单的翻页的代码?
exit;可以去掉exit;
$query="INSERT into sms_yy(id,content,length,author,sendtime,comments) values('$id', '$content', '$length', '$author', '$sendtime', '$comments')";不起作用
只要echo$query是否有值再作决定
putenv("ORACLE_SID=oracle");
putenv("NLS_LANG=american_taiwan.zht16big5");
$handle=ora_logon("system","tiger") or die;
$cursor=ora_open($handle);
ora_commitoff($handle);
$query="INSERT into sms_yy(id,content,author,comment) values('$id', '$content', '$author', '$comment' )";
ora_parse($cursor, $query) or die;
ora_exec($cursor);
ora_close($cursor);
ora_logoff($handle);
Header("Location: addmsg.php");
exit;} else {
?><html>
<head>
<title>成功写入</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF" text="#000000">
<table width="80%" border="0" cellspacing="0" cellpadding="0" height="58">
<tr bgcolor="#0066FF" bordercolor="#FFFFFF">
<td width="21%" height="2">
<div align="center"><font color="#FFFFFF">短语代码</font></div>
</td>
<td width="25%" height="2">
<div align="center"><font color="#FFFFFF">内容</font></div>
</td>
<td width="27%" height="2">
<div align="center"><font color="#FFFFFF">短语作者</font></div>
</td>
<td width="27%" height="2">
<div align="center"><font color="#FFFFFF">备注</font></div>
</td>
</tr>
<tr>
<td height="15" width="21%">
<div align="center"><?="$id"?></div>
</td>
<td height="15" width="25%">
<div align="center"> <?="$content"?></div>
</td>
<td height="15" width="27%">
<div align="center"><?="$author"?></div>
</td>
<td height="15" width="27%">
<div align="center"><?="$comments"?></div>
</td>
</tr>
</table>
</body>
</html>
<?php
}
?>
错误如下:
Warning: Oracle: Connection Failed: ORA-12560: TNS:协议适配器错误 in D:\www\xxx\add.php on line 7