📄 add.php
字号:
<?php
include_once("include/conn.php");
include_once("include/config.php");
include_once("include/function.php");
//提交留言
if(isset($btnSubmit))
{
$rs = @new COM("ADODB.RecordSet") or die ("创建记录集失败!");
$rs->Open("select top 1 * from gb_main",$conn,1,3);
$rs->addnew;
$rs->fields["gb_title"]->Value=trim($_REQUEST["txt_title"]);
$rs->fields["gb_user"]->Value=trim($_REQUEST["txt_user"]);
$rs->fields["gb_face"]->Value=$_REQUEST["txt_face"];
$rs->fields["gb_from"]->Value=trim($_REQUEST["txt_from"]);
$rs->fields["gb_oicq"]->Value=trim($_REQUEST["txt_oicq"]);
$rs->fields["gb_homepage"]->Value=trim($_REQUEST["txt_homepage"]);
$rs->fields["gb_email"]->Value=trim($_REQUEST["txt_email"]);
$rs->fields["gb_emote"]->Value=$_REQUEST["txt_emote"];
$rs->fields["gb_secret"]->Value=$_REQUEST["txt_secret"];
$rs->fields["gb_content"]->Value=stripslashes($_REQUEST["txt_content"]);
if ($cfg_check==0)
{
$rs->fields["gb_show"]->Value=1;
}
else
{
$rs->fields["gb_show"]->Value=0;
}
$rs->fields["gb_datetime"]->Value=gettime();
$rs->fields["gb_ip"]->Value=getip();
$rs->fields["gb_delete"]->Value=0;
$rs->update;
$rs->close();
$rs=null;
if ($cfg_check==0){
header("location:index.php");
}
else
{
alert("您的留言需要审核后才能显示!","index.php");
}
exit;
}
$conn->close();
$conn=null;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>签写留言--<?php echo $cfg_name; ?></title>
<link href="skin/<?php echo $cfg_skin; ?>.css" rel="stylesheet" type="text/css">
<meta name="keywords" content="<?php echo $cfg_keywords; ?>">
<meta name="description" content="<?php echo $cfg_description; ?>">
<script language="JavaScript">
<!--
window.onload=function ()
{
var obj=document.frm_add;
obj.onsubmit=function()
{
if(obj.txt_title.value==""){
obj.txt_title.focus();
alert("留言主题不能为空!")
return false;
}
if(obj.txt_user.value==""){
obj.txt_user.focus();
alert("请填写您的称呼!");
return false;
}
<?php
if ($cfg_editor==2){
?>
if (eWebEditor1.getHTML()=="")
{
alert("请填写留言内容!");
return false;
}
<?php
}
else
{
?>
if(obj.txt_content.value==""){
obj.txt_content.focus();
alert("请填写留言内容!");
return false;
}
<?php
}
?>
}
}
//-->
</script>
</head>
<body>
<!--签写留言开始-->
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" height="20"><img src="skin/<?php echo $cfg_skin; ?>/top_left.gif" width="30" height="20"></td>
<td background="skin/<?php echo $cfg_skin; ?>/top_mid.gif"> </td>
<td width="30"><img src="skin/<?php echo $cfg_skin; ?>/top_right.gif" width="30" height="20"></td>
</tr>
</table>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0" class="td_border">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form name="frm_add" methord="post" action="<?php echo $PHP_SELF; ?>">
<tr>
<td width="20%" height="25" align="right" class="txt_bold"><font color="#FF0000">*</font>留言主题:</td>
<td><input name="txt_title" type="text" class="frm_input" size="40"></td>
<td align="center">↓当前头像↓</td>
</tr>
<tr>
<td height="25" align="right" class="txt_bold"><font color="#FF0000">*</font>您的称呼:</td>
<td><input name="txt_user" type="text" class="frm_input" size="20"></td>
<td width="25%" rowspan="5" align="center">
<table width="100%">
<tr>
<td align="center">
<select name="txt_face" onChange="document.images['face'].src='images/face/'+options[selectedIndex].value;">
<?php
for ($i=1;$i<=49;$i++){
echo "<option value=\"tou$i.gif\">头像$i</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td align="center"><img id="face" src="images/face/tou1.gif"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="25" align="right" class="txt_bold">来自地区:</td>
<td><input name="txt_from" type="text" class="frm_input" size="20"></td>
</tr>
<tr>
<td height="25" align="right" class="txt_bold">OICQ:</td>
<td><input name="txt_oicq" type="text" class="frm_input" size="20"></td>
</tr>
<tr>
<td height="25" align="right" class="txt_bold">主页:</td>
<td><input name="txt_homepage" type="text" class="frm_input" size="40"></td>
</tr>
<tr>
<td height="25" align="right" class="txt_bold">Email:</td>
<td><input name="txt_email" type="text" class="frm_input" size="40"></td>
</tr>
<?php if ($cfg_emot=="1"){ ?>
<tr>
<td height="25" align="right" class="txt_bold">当前心情:</td>
<td colspan="2">
<?php
for ($i=1;$i<=36;$i++){
echo "<input type=\"radio\" name=\"txt_emote\" value=\"em$i.gif\"><img src=\"images/emot/em$i.gif\"> ";
if ($i%9==0){echo "<br>";}
}
?>
</td>
</tr>
<?php } ?>
<tr>
<td height="25" align="right" class="txt_bold">保密留言:</td>
<td><input name="txt_secret" type="radio" value="0" checked>否
<input type="radio" name="txt_secret" value="1">是</td>
<td> </td>
</tr>
<tr>
<td colspan="3" align="center">
<?php
if ($cfg_editor==2){
?>
<input type="hidden" name="txt_content" value="">
<IFRAME ID="eWebEditor1" src="editor/ewebeditor.htm?id=txt_content&style=coolblue" frameborder="0" scrolling="no" width="548" height="350"></IFRAME>
<?php
}
else
{
?>
<textarea name="txt_content" rows="10" class="frm_textarea"></textarea>
<?php
}
?>
</td>
</tr>
<tr>
<td height="40" colspan="3" align="center">
<input name="btnSubmit" type="submit" class="frm_button" value="发布留言">
<input name="btnReset" type="reset" class="frm_button" value="重新填写">
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" height="15"><img src="skin/<?php echo $cfg_skin; ?>/bom_left.gif" width="30" height="15"></td>
<td background="skin/<?php echo $cfg_skin; ?>/bom_mid.gif"> </td>
<td width="30"><img src="skin/<?php echo $cfg_skin; ?>/bom_right.gif" width="30" height="15"></td>
</tr>
</table>
<!--签写留言结束-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -