⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 add.php

📁 某自制区政府网站源代码.数据库为Access,包含完整的数据库.
💻 PHP
字号:
<?php

// ------------------------- -------- ------------------------- //

require ("../include/config.inc.php");
require ("./global.php");

// ------------------------- -------- ------------------------- //

mysql_connect($dbhost,$dbuser,$dbpasswd) or die ("数据库连接失败");

// check cookie
islogin($HTTP_COOKIE_VARS[$cookie_name][1],$HTTP_COOKIE_VARS[$cookie_name][2]);

$cookie_user = $HTTP_COOKIE_VARS[$cookie_name][1];


// ------------------------- sendadd -------------------------

if ($sendadd):
addrecord($title,$author,$fromsite,$text,$img,$download,$sortid,$isshow,$ishtml);
echo "<br><center><a href=add.php>已添加</a><br>";
echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL=add.php'>";
exit;
endif;


// ------------------------- -------- ------------------------- //

include ("../include/header.inc.php");

echo "<title>$site_name - 控制面板 - powered by yemao.net</title>\n";
echo "<center><br>\n";


// 搜索跳转 ------------------------------

echo "<br><table border=0 cellpadding=3 cellspacing=0 style='border-collapse:collapse' bordercolor=#efefef width=735>\n";
echo "<tr>\n";
echo "<td class=shadow2 width=190 valign=bottom>\n";


// 本类/总数 ------------------------------

all_and_this();


// 搜索表单 ------------------------------

$typesql = "SELECT COUNT(*) AS rcnt FROM $ym_article_sort_table ORDER BY id";
$typeresult = mysql_db_query($dbname, $typesql);
$typerow = mysql_fetch_array($typeresult);

$typesql = "SELECT * FROM $ym_article_sort_table ORDER BY id";
$typeresult = mysql_db_query($dbname, $typesql);


echo "</td>\n";
echo "<form method=POST action=list.php>\n";
echo "<td width=405 align=center valign=bottom>\n";
echo "<img src='../images/search.gif' width=16 heigth=16> ";

echo "标题<input type=checkbox name=title value='1' ";
echo ($name == 0 ? '' : checked);
echo ">\n";

echo "内容<input type=checkbox name=text value='1' ";
echo ($brief == 0 ? '' : checked);
echo ">\n";

echo "<input class=border type=text name=keyword size=12 style='color:#000000; background-color:#efefef'>\n";

echo "<select size=1 name=searchtype style='color:#000000; border-style:solid; border-width:1; background-color:#efefef'>\n";
echo "<option value=0 selected>所有文章</option>\n";
while ($typerow=mysql_fetch_array($typeresult)) {
echo "<option value=".$typerow[id].">".$typerow[name]."</option>\n";
}



echo "</select> \n";

echo "<input class=border type=submit value=搜索 name=search style='color: #000000; background-color: #efefef'>\n";
echo "</td></form>";


// 跳转分类 -----------------------------

goto($type);

echo "</tr>\n";
echo "</table>\n";
echo "<br>\n";


// ---------------------------------------

echo "<table border=0 cellspacing=0 style='border-collapse:collapse' width=735 height=233 cellpadding=3>\n";
echo "<tr>\n";


// 栏目菜单 ------------------------------

echo "<td width=185 valign=top>\n";
adminmenu();
echo "</td>\n";


// ---------------------------------------

echo "<td width=550 height=233 valign=top>\n";


// 转到搜索 ------------------------------

if ($search):
search($keyword,$searchtype,$title,$text);
end;
else:

// ---------------------------------------

?>

<center>
<table  style="border-collapse: collapse" bordercolor="#111111" bgcolor=#efefef border=1 cellspacing=0 cellpadding=3 width=500><col width=100><col width=400>

<tr>
<form action="add.php" method="POST">
<td align=right>标题:</td>
<td><input type=text name=title size=40 value=""></td>
</tr>

<tr bgcolor=#f7f7f7>
<td align=right>作者:</td>
<td><input type=text name=author size=20 value=<? echo $HTTP_COOKIE_VARS[$cookie_name][1];?>></td>
</tr>

<tr>
<td align=right>来源:</td>
<td><input type=text name=fromsite size=20 value=""></td>
</tr>

<tr bgcolor=#f7f7f7>
<td align=right>内容:</td>
<td><textarea rows=8 name=text cols=50></textarea></td>
</tr>

<tr>
<td align=right>图片文件:</td>
<td><input type=text name=img size=30 value="<? echo $img_name;?>">
只需填文件名, 如有请先上传.</td>
</tr>

<tr bgcolor=#f7f7f7>
<td align=right>压缩文件:</td>
<td><input type=text name=download size=30 value="<? echo $file_name;?>">
只需填文件名, 如有请先上传.</td>
</tr>

<tr>
<td align=right>日期:</td>
<td>
<?
$date = date($datetxt,time());
echo $date;
?></td>
</tr>

<tr bgcolor=#f7f7f7>
<td align=right>程序分类:</td>
<?
$typesql = "SELECT COUNT(*) AS rcnt FROM $ym_article_sort_table ORDER BY id";
$typeresult = mysql_db_query($dbname, $typesql) or die ("数据库连接失败");
$typerow = mysql_fetch_array($typeresult);

$typesql = "SELECT * FROM $ym_article_sort_table ORDER BY id";
$typeresult = mysql_db_query($dbname, $typesql);
?>
<td><select size=1 name=sortid>
<?
while ($typerow=mysql_fetch_array($typeresult)){
echo "<option value=".$typerow[id].">".$typerow[name]."</option>\n";
}
?>
</select>
</td>
</tr>

<tr>
<td align=right>是否显示:</td>
<td><input type=checkbox name=isshow value='1' 
<? echo ($isshow == 0 ? '' : checked);?>
></td>
</tr>

<tr bgcolor=#f7f7f7>
<td align=right>使用HTML:</td>
<td><input type=checkbox name=ishtml value='1' 
<? echo ($isshow == 0 ? '' : checked);?>
></td>
</tr>

<tr>
<td width=492 colspan=2 align=center>
<input type=submit value=" 提交 " name=sendadd>
<input type=reset value=" 重填 "></td>
</form>
</tr>
</table>
<br><br>

<table  style="border-collapse: collapse" bordercolor="#111111" bgcolor=#efefef border=1 cellspacing=0 cellpadding=3 width=500>
<col width=100><col width=400>
<tr><form enctype="multipart/form-data" action="up_img.php?file=add.php&file_name=<? echo $file_name;?>" method="POST">
<td align=right>图片文件:</td>
<td>
<input type=file name=upfile size=30 value="" 
<?
if (!empty($img_name) || !$img==""):
echo "disabled";
endif;
?>
>
<input type=submit value=" 上传 " 
<?
if (!empty($img_name) || !$img==""):
echo "disabled";
endif;
?>
>
</td>
</form>
</tr>
</table>
<br>
<table  style="border-collapse: collapse" bordercolor="#111111" bgcolor=#efefef border=1 cellspacing=0 cellpadding=3 width=500>
<col width=100><col width=400>
<tr>
<form enctype="multipart/form-data" action="up_file.php?file=add.php&img_name=<? echo $img_name;?>" method="POST">
<td align=right>压缩文件:</td>
<td>
<input type=file name=upfile size=30 value="" 
<?
if (!empty($file_name) || !$download==""):
echo "disabled";
endif;
?>
>
<input type=submit value=" 上传 " 
<?
if (!empty($file_name) || !$download==""):
echo "disabled";
endif;
?>
>
</td>
</form>
</tr>
</table>


<?

endif; // if search

echo "</td>\n";

echo "</tr>\n";
echo "</table>\n";
echo "<br><hr width=735>\n";

mysql_close();

// ------------------------- -------- ------------------------- //

include ("../include/footer.inc.php");

// ------------------------- -------- ------------------------- //

?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -