|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
php manual(PHP手册)肯定是要从网上下载一个的,它很权威,也很全面,我自己认为它是一本很好的参考书,但是不适合新手当教材使用。 post.php(发新贴子)
<HTML><HEAD><TITLE>疑问成绩</TITLE>
<LINK href="mypic/style.CSS" rel=STYLESHEET type=text/css></HEAD>
<?php
if (!$cookie_user)
{echo "<script language='javascript'>";
echo "parent.location.href='index.php'";
echo "</script>";}
else {include ("connect.inc.php");
$query = "select * from my_user where user='".$cookie_user."' and password='".$cookie_password."'";
$res = mysql_query($query);
if (!$res)
{echo "<script language='javascript'>";
echo "parent.location.href='index.php'";
echo "</script>";}
include "connect.inc.php";
if ($theme) {$content=htmlspecialchars($content);
$content=nl2br($content);
$theme=htmlspecialchars($theme);
$theme=nl2br($theme);
$query = "INSERT INTO guestbook (name,type,theme,content,icon,time_open,time_close,answer_count,answer_name) VALUES ('".$cookie_user."',1,'".$theme."','".$content."',".$icon.",now(),now(),1,'".$cookie_user."')";
$res = mysql_query($query);
if ($res)
{echo "<script language='javascript'>";
echo "parent.location.href='post_end.php'";
echo "</script>";}
else echo $query;}}
?>
<SCRIPT language=JavaScript>
<!--
var submitcount=0;
function check_com(){
if(document.form.theme.value.length ==0){
submitcount--;
alert("主题不克不及为空!nYou must supply a subject.");
return false;
}
if(document.form.content.value.length == 0){
submitcount--;
alert("加贴内容不克不及为空!nYou must supply a message.");
return false;
}
return true;
}
//-->
</SCRIPT>
<BODY bgColor=#cccc99 bottomMargin=0 leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%" class=body_br>
<TBODY>
<SCRIPT language=JavaScript
src="mypic/x.js"></SCRIPT>
<TR>
<TD vAlign=top>
<FORM action=post.php?forum_id=11 method=post name=form
>
<TABLE align=center border=0 cellPadding=4 cellSpacing=0 width=100%>
<TBODY>
<TR>
<TD class=mid width=20%>主 题</TD>
<TD><INPUT maxLength=30 name=theme size=50> </TD>
<TR>
<TD class=mid vAlign=top>脸色图标</TD>
<TD><INPUT CHECKED name=icon type=radio value=1> <IMG
align=ABSCENTER height=18
src="http://edu.cnzz.cn/NewsInfo/mypic/icon1.gif"
width=18><INPUT name=icon type=radio value=2> <IMG
align=ABSCENTER height=18
src="http://edu.cnzz.cn/NewsInfo/mypic/icon2.gif"
width=18><INPUT name=icon type=radio value=3> <IMG
align=ABSCENTER height=18
src="http://edu.cnzz.cn/NewsInfo/mypic/icon3.gif"
width=18><INPUT name=icon type=radio value=4> <IMG
align=ABSCENTER height=18
src="http://edu.cnzz.cn/NewsInfo/mypic/icon4.gif"
width=18><INPUT name=icon type=radio value=5> <IMG
align=ABSCENTER height=18
src="http://edu.cnzz.cn/NewsInfo/mypic/icon5.gif"
width=18><INPUT name=icon type=radio value=6> <IMG
align=ABSCENTER height=18
src="http://edu.cnzz.cn/NewsInfo/mypic/icon6.gif"
width=18><INPUT name=icon type=radio value=7> <IMG
align=ABSCENTER height=18
src="http://edu.cnzz.cn/NewsInfo/mypic/icon7.gif"
width=18><BR><INPUT name=icon type=radio value=8> <IMG
align=ABSCENTER height=18
src="http://edu.cnzz.cn/NewsInfo/mypic/icon8.gif"
width=18><INPUT name=icon type=radio value=9> <IMG
align=ABSCENTER height=18
src="http://edu.cnzz.cn/NewsInfo/mypic/icon9.gif"
width=18><INPUT name=icon type=radio value=10> <IMG
align=ABSCENTER height=18
src="http://edu.cnzz.cn/NewsInfo/mypic/icon10.gif"
width=18><INPUT name=icon type=radio value=11> <IMG
align=ABSCENTER height=18
src="http://edu.cnzz.cn/NewsInfo/mypic/icon11.gif"
width=18><INPUT name=icon type=radio value=12> <IMG
align=ABSCENTER height=18
src="http://edu.cnzz.cn/NewsInfo/mypic/icon12.gif"
width=18><INPUT name=icon type=radio value=13> <IMG
align=ABSCENTER height=18
src="http://edu.cnzz.cn/NewsInfo/mypic/icon13.gif"
width=18><INPUT name=icon type=radio value=14> <IMG
align=ABSCENTER height=18
src="http://edu.cnzz.cn/NewsInfo/mypic/icon14.gif"
width=18></TD></TR>
<TR>
<TD class=mid vAlign=top>加贴内容</TD>
<TD><TEXTAREA cols=50 name=content rows=6></TEXTAREA> </TD></TR>
<TR>
<TD> </TD>
<TD><INPUT name=submit type=submit value=" 发 表 ">
<INPUT name=reset type=reset value=" 清 除 "> </TD></TR>
</TBODY></TABLE></FORM></TD></TR>
</TBODY></TABLE>
</FORM>
</html>
聪明的你,显然已经逐渐的开悟了,慢慢的理解了编程的概念,那么祝贺你,你已经迈出了成功的第一步。 |
|