📄 index.php
字号:
<?php
include_once( "inc/auth.php" );
echo "\r\n<html>\r\n<head>\r\n<title>个人网址管理</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n\r\n<script Language=\"JavaScript\">\r\nfunction CheckForm()\r\n{\r\n if(document.form1.URL_DESC.value==\"\")\r\n { alert(\"说明不能为空!\");\r\n return (false);\r\n }\r\n if(document.form1.URL.value==\"\")\r\n { alert(\"网址不能为空!\");\r\n return (false);\r\n }\r\n\r\n if (document.form1.ATTACHMENT.value!=\"\")\r\n {\r\n var file_temp=document.form1.ATTACHMENT.value,ext_name;\r\n var Pos;\r\n Pos=file_temp.lastIndexOf(\".\");\r\n ext_name=file_temp.substring(Pos,file_temp.length);\r\n document.form1.ATTACHMENT_NAME.value=ext_name;\r\n }\r\n}\r\n\r\nfunction delete_url(URL_ID)\r\n{\r\n msg='确认要删除该项网址么?';\r\n if(window.confirm(msg))\r\n {\r\n URL=\"delete.php?URL_ID=\" + URL_ID;\r\n window.location=URL;\r\n }\r\n}\r\n\r\n\r\nfunction delete_all()\r\n{\r\n msg='确认要删除所有网址么?';\r\n if(window.confirm(msg))\r\n {\r\n URL=\"delete_all.php\";\r\n window.location=URL;\r\n }\r\n}\r\n\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\" onload=\"document.form1.URL_NO.focus();\">\r\n\r\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n <tr>\r\n <td class=\"Big\"><img src=\"/images/notify_new.gif\" align=\"absmiddle\"><span class=\"big3\"> 添加个人网址</span>\r\n </td>\r\n </tr>\r\n</table>\r\n\r\n<table border=\"0\" cellspacing=\"1\" width=\"450\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\" align=\"center\" >\r\n <form action=\"add.php\" method=\"post\" name=\"form1\" onsubmit=\"return CheckForm();\"> \r\n <tr>\r\n <td nowrap class=\"TableData\">序号:</td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"URL_NO\" class=\"BigInput\" size=\"10\" maxlength=\"25\">\r\n </td>\r\n <tr>\r\n <td nowrap class=\"TableData\">说明:</td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"URL_DESC\" class=\"BigInput\" size=\"25\" maxlength=\"200\">\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableData\">图片:</td>\r\n <td class=\"TableData\">\r\n <input type=\"file\" name=\"ATTACHMENT\" size=\"40\" class=\"BigInput\" title=\"选择附件文件\" value=\"";
echo $ATTACHMENT;
echo "\">\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableData\">网址:</td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"URL\" class=\"BigInput\" size=\"25\" maxlength=\"200\" value=\"http://\">\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableControl\" colspan=\"2\" align=\"center\">\r\n <input type=\"hidden\" value=\"\" name=\"ATTACHMENT_NAME\">\r\n <input type=\"submit\" value=\"添加\" class=\"BigButton\" title=\"添加网址\" name=\"button\"> \r\n </td>\r\n </form>\r\n</table>\r\n\r\n<br>\r\n\r\n<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"3\">\r\n <tr>\r\n <td background=\"/images/dian1.gif\" width=\"100%\"></td>\r\n </tr>\r\n</table>\r\n\r\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n <tr>\r\n <td class=\"Big\"><img src=\"/images/notify_open.gif\" align=\"absmiddle\"><span class=\"big3\"> 管理个人网址</span>\r\n </td>\r\n </tr>\r\n</table>\r\n\r\n<br>\r\n<div align=\"center\">\r\n\r\n";
$query = "SELECT * from URL where USER='".$LOGIN_USER_ID."' order by URL_NO";
$connection = openconnection( );
$cursor = exequery( $connection, $query );
$URL_COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor ) )
{
++$URL_COUNT;
$URL_ID = $ROW['URL_ID'];
$URL_NO = $ROW['URL_NO'];
$URL_DESC = $ROW['URL_DESC'];
$URL = $ROW['URL'];
$PHOTO = $ROW['PHOTO'];
if ( $URL_COUNT == 1 )
{
echo "\r\n <table border=\"0\" cellspacing=\"1\" width=\"450\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\">\r\n\r\n";
}
echo " <tr class=\"TableData\">\r\n <td nowrap align=\"center\">";
echo $URL_NO;
echo "</td>\r\n <td nowrap align=\"center\">";
echo $URL_DESC;
echo "</td>\r\n <td nowrap align=\"center\">\r\n \t";
if ( $PHOTO != "" )
{
echo "<A href=\"view_photo.php?PHOTO=".$PHOTO."\" target=\"_blank\">查看</A>";
}
echo " \t</td>\r\n <td nowrap align=\"center\"><A href=\"";
echo $URL;
echo "\" target=\"_blank\">";
echo $URL;
echo "</A></td>\r\n <td nowrap align=\"center\" width=\"80\">\r\n <a href=\"edit.php?URL_ID=";
echo $URL_ID;
echo "\"> 编辑</a>\r\n <a href=\"javascript:delete_url('";
echo $URL_ID;
echo "');\"> 删除</a>\r\n </td>\r\n </tr>\r\n";
}
if ( 0 < $URL_COUNT )
{
echo " <thead class=\"TableHeader\">\r\n <td nowrap align=\"center\">序号</td>\r\n <td nowrap align=\"center\">说明</td>\r\n <td nowrap align=\"center\">图片</td>\r\n <td nowrap align=\"center\">网址</td>\r\n <td nowrap align=\"center\">操作</td>\r\n </thead>\r\n <thead class=\"TableControl\">\r\n <td nowrap align=\"center\" colspan=\"5\">\r\n <input type=\"button\" class=\"BigButton\" OnClick=\"javascript:delete_all();\" value=\"全部删除\">\r\n </td>\r\n </thead>\r\n </table>\r\n";
}
else
{
message( "", "尚未添加网址" );
}
echo "\r\n</div>\r\n\r\n</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -