📄 image.php
字号:
<?php
include( "../../config.inc.php" );
include( "../../includes/SysGlobal.php" );
include( "../language/".$aLan."_".$charset.".php" );
include( "../../includes/version.php" );
include( "../../includes/pro.php" );
include( "../func/adm.inc.php" );
include( "../func/db.inc.php" );
needauth( 0 );
error_reporting( E_ERROR | E_WARNING | E_PARSE );
echo "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=";
echo $charset;
echo "\">\r\n<link rel=stylesheet type=text/css href=style.css>\r\n<title>";
echo $strImageTitle;
echo "</title>\r\n";
echo "<s";
echo "cript>\r\nfunction UploadPic () {\r\n\tchose.style.display = \"none\";\r\n\tupload.style.display = \"block\";\r\n}\r\nfunction AlertErrow (say) {\r\n\talert (say);\r\n\treturn false;\r\n}\r\nfunction ReturnValue (path) {\r\n\treturnValue = path;\r\n\twindow.close ();\r\n}\r\n</script>\r\n</head>\r\n\r\n<body leftmargin=\"0\" topmargin=\"0\" class=\"bodybackground\">\r\n<center>\r\n";
$Submit = $_POST['Submit'];
$radiobutton = $_POST['radiobutton'];
if ( $Submit == $strConfirm && $radiobutton != "upload" )
{
echo "<script>ReturnValue ('piclib')</script>";
}
else if ( $Submit == $strConfirm )
{
$img = $_FILES['pic'];
if ( $img['size'] < 0 )
{
echo "<script>AlertErrow ('".$strUploadNotice1."');</script>";
}
else if ( $img['size'] < 204800 )
{
if ( $img['type'] == "image/gif" || $img['type'] == "image/pjpeg" || $img['type'] == "image/jpg" || $img['type'] == "image/x-png" )
{
switch ( $img['type'] )
{
case "image/gif" :
$extention = ".gif";
break;
case "image/pjpeg" :
$extention = ".jpg";
break;
case "image/jpg" :
$extention = ".jpg";
break;
case "image/x-png" :
$extention = ".png";
break;
}
$img_directory = "../../pic/gif/";
if ( !file_exists( $img_directory ) )
{
@mkdir( $img_directory, 511 );
}
$file_name = time( ).$extention;
$file_path = $img_directory.$file_name;
copy( $img['tmp_name'], $file_path );
chmod( $file_path, 438 );
$file_path = str_replace( "../../", $SiteUrl, $file_path );
echo "<script>ReturnValue ('".$file_path."')</script>";
}
else
{
echo "<script>AlertErrow ('".$strUploadNotice4."');</script>";
}
}
else
{
echo "<script>AlertErrow ('".$strUploadNotice2."');</script>";
}
}
echo " <table width=\"20\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n <tr>\r\n <td><img src=\"dot.gif\" height=\"7\" width=\"1\"></td>\r\n </tr>\r\n </table>\r\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\">\r\n <form action=\"\" method=\"post\" enctype=\"multipart/form-data\">\r\n <tr> \r\n <td valign=\"middle\">\r\n<table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"0\" id=\"chose\">\r\n ";
echo " <tr> \r\n <td>\r\n<input type=\"radio\" name=\"radiobutton\" value=\"upload\" onClick=\"UploadPic ()\">\r\n <a href=\"#\" style=\"cursor:default;color:#000000;text-decoration: none;\" onClick=\"radiobutton[0].checked = true;UploadPic ()\">";
echo $strHtmlImageUpload;
echo "</a></td>\r\n </tr>\r\n <tr> \r\n <td>\r\n<input name=\"radiobutton\" type=\"radio\" value=\"chose\" checked>\r\n <a href=\"#\" style=\"cursor:default;color:#000000;text-decoration: none;\" onClick=\"radiobutton[1].checked = true\">";
echo $strHtmlImageFromLib;
echo "</a></td>\r\n </tr>\r\n </table>\r\n <table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"0\" id=\"upload\" style=\"display:none\">\r\n <tr> \r\n <td>";
echo $strHtmlImageSelect;
echo "</td>\r\n </tr>\r\n <tr>\r\n <td><input type=\"file\" name=\"pic\" style=\"width:100%\"></td>\r\n </tr>\r\n </table></td>\r\n <td width=\"2\"><img src=\"images/separator.gif\" width=\"2\" height=\"50\"></td>\r\n <td width=\"60\" valign=\"middle\"> \r\n <table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\">\r\n <tr> \r\n <td align=\"center\"> \r\n ";
echo " <input type=\"submit\" name=\"Submit\" value=\"";
echo $strConfirm;
echo "\" style=\"width:55;\"></td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\"> \r\n <input type=\"button\" name=\"Submit2\" value=\"";
echo $strCancel;
echo "\" style=\"width:55;\" onClick=\"window.close ();\"></td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n\t</form>\r\n </table>\r\n</center>\r\n</body>\r\n</html>\r\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -