新手求救!!!! 用分数来问问题吧,别人会回答的,没有分数可能看的人少。1、自动关闭你用JS的window.close就行了。2、如果你第一个问题还不能解决,说明你很多东西还没学,留言板完要进行程序处理才能真正把留言留下来 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1,用javascript代码来做,2,可能是你学php的书太老,接收post来的变量为空,没存入数据库,所以无法显示。请确认是否正确收到post来的留言信息。 留言簿就这个PHP<? session_start();?><?include "c:\\include\\config.php"; $conn=mysql_connect($hostname,$dbusername,$dbpassword); @mysql_select_db("$dbname") ;?><html><head><meta http-equiv="Content-Language" content="zh-cn"><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta name="GENERATOR" content="Microsoft FrontPage 4.0"><meta name="ProgId" content="FrontPage.Editor.Document"><title>liuyan</title></head><body><p> <b><i><font color="#FF9933"> <u>!leaveword </u> </font></i></b> <font size="6" color="#008000"><b>留言簿</b></font></p><hr><form method="POST" action="liuyan.php" ><table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td width="100%"></td></tr> <tr><td width="100%"></td></tr> <tr><td width="100%"></td></tr> <tr><td width="100%"></td></tr> <? $query="select username,title,content,realname,time from alumni_liuyan order by time limit 0,10"; $result = mysql_db_query($dbname,$query); $i=0; while($data = mysql_fetch_array($result)) { $data_detail[$i]=$data; echo"<tr>"; echo"<td width=100%>主题:".$data_detail[$i][1]."</td></tr>"; echo"<tr><td width=100%>内容:".$data_detail[$i][2]."</td></tr>"; echo"<tr><td width=100%>留言人:".$data_detail[$i][3]."</td></tr>"; echo"<tr><td width=100%>".$data_detail[$i][4]."</td>"; echo"</tr>"; $i++; } mysql_free_result($result); mysql_close($conn); ?> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td width="100%">留言人:<?echo $userrealname;?></td> </tr> <tr> <td width="100%">留言主题: <p><input type="text" name="title" size="20"></p> </td> </tr> <tr> <td width="100%">留言内容: <p><textarea rows="2" name="content" cols="20"></textarea></p> </td> </tr> <tr> <td width="100%"> <p><input type="submit" value="提交" name="submit"><input type="reset" value="全部重写" name="reset"></p> </td> </tr></table></form><? parse_str($QUERY_STRING); include "c:\\include\\config.php"; $conn=mysql_pconnect($hostname,$dbusername,$dbpassword) or die("不能连接数据库!"); @mysql_select_db("$dbname") or die("不能选择数据库!"); $query="insert into alumni_liuyan(username,title,content,realname,time) values ('".$loginusername."','".$title."','".$content."','".$userrealname."',now())"; $result=mysql_query($query); mysql_close();?></body></html> 求高手,我的phpmydamin配置哪里出了问题了? 防止页面执行超时设置 apache在配置php时无法启动了 急! 一道很简单的题目。PHP.Linux.Ajax-JQUERY 求一个PHP+MSSQL的分页 php+soap的程序运行不了一般是什么问题啊? 下载下来的论坛程序代码,要怎样设置????? 提交表格到本身用什么来着? 为什么不能获取上传文件类型? 碰到PHP很棘手的问题,很痛苦!各位大侠请拉小弟一把!! 如果php.ini 里关了报错~ 在程序里面有办法让报错信息显示出来吗? 在phpMyAdmin2.53rc1基础上改的中文版想要的跟贴
2,可能是你学php的书太老,接收post来的变量为空,没存入数据库,所以无法显示。请确认是否正确收到post来的留言信息。
<?
session_start();
?><?include "c:\\include\\config.php"; $conn=mysql_connect($hostname,$dbusername,$dbpassword);
@mysql_select_db("$dbname") ;
?><html><head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>liuyan</title>
</head><body><p> <b><i><font color="#FF9933"> <u>!leaveword
</u> </font></i></b>
<font size="6" color="#008000"><b>留言簿</b></font></p>
<hr>
<form method="POST" action="liuyan.php" >
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td width="100%"></td></tr>
<tr><td width="100%"></td></tr>
<tr><td width="100%"></td></tr>
<tr><td width="100%"></td></tr>
<?
$query="select username,title,content,realname,time from alumni_liuyan order by time limit 0,10";
$result = mysql_db_query($dbname,$query); $i=0;
while($data = mysql_fetch_array($result)) {
$data_detail[$i]=$data;
echo"<tr>";
echo"<td width=100%>主题:".$data_detail[$i][1]."</td></tr>";
echo"<tr><td width=100%>内容:".$data_detail[$i][2]."</td></tr>";
echo"<tr><td width=100%>留言人:".$data_detail[$i][3]."</td></tr>";
echo"<tr><td width=100%>".$data_detail[$i][4]."</td>";
echo"</tr>";
$i++;
}
mysql_free_result($result);
mysql_close($conn);
?>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%">留言人:<?echo $userrealname;?></td>
</tr>
<tr>
<td width="100%">留言主题:
<p><input type="text" name="title" size="20"></p>
</td>
</tr>
<tr>
<td width="100%">留言内容:
<p><textarea rows="2" name="content" cols="20"></textarea></p>
</td>
</tr>
<tr>
<td width="100%">
<p><input type="submit" value="提交" name="submit"><input type="reset" value="全部重写" name="reset"></p>
</td>
</tr>
</table>
</form>
<?
parse_str($QUERY_STRING);
include "c:\\include\\config.php";
$conn=mysql_pconnect($hostname,$dbusername,$dbpassword) or die("不能连接数据库!");
@mysql_select_db("$dbname") or die("不能选择数据库!"); $query="insert into alumni_liuyan(username,title,content,realname,time) values ('".$loginusername."','".$title."','".$content."','".$userrealname."',now())";
$result=mysql_query($query); mysql_close();?></body></html>