📄 div_image_insert.php
字号:
<?php
echo "<html>\r\n";
include_once( "inc/conn.php" );
$tempid = $_GET['tempid'];
$tagdiv = $_POST['bgtag'];
$http_url1 = $_SERVER['DOCUMENT_ROOT'];
$http_url = str_replace( "/", "\\", "{$http_url1}" );
$mulu = $http_url."attachment\\index_img"."\\"."{$tempid}";
if ( file_exists( $mulu ) )
{
}
else
{
mkdir( $mulu );
$newmulu = "attachment/index_img/".$tempid;
echo "<script>alert('新建目录".$newmulu."成功'); </script>";
}
if ( isset( $_FILES['newpic'] ) )
{
$pt = split( "/", $_FILES['newpic']['type'] );
if ( $pt[0] != "image" )
{
echo "<script>alert('只能传图片'); </script>";
}
else
{
$img_dir = $mulu."\\";
if ( copy( $_FILES['newpic']['tmp_name'], "{$img_dir}".$_FILES['newpic']['name'] ) )
{
echo "<script>alert('上传成功'); </script>";
$now_url = "attachment/index_img/"."{$tempid}"."/";
$imgurl = "/"."{$now_url}".$_FILES['newpic']['name'];
$sql = "INSERT INTO `index_div` (`DIV_ID`, `IMGURL`, `X_AXES`, `Y_AXES`, `Z_AXES`,`TAGDIV`,`TEMPID`) VALUES (NULL, '{$imgurl}', '50', '50', '1','{$tagdiv}','{$tempid}');";
$result = exequery( $connection, $sql );
}
else
{
echo "图片上传失败";
}
}
echo "<s";
echo "cript type=\"text/javascript\">\r\nwindow.location.href=\"login_index.php?tempid=\"+";
echo $tempid;
echo ";\r\n</script>\r\n";
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -