PHP,Js,Ajax实现多图片上传

引入JS

HTML 上传图片

CSS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
.btn {
    -webkit-border-radius:3px;
    -moz-border-radius:3px;
    -ms-border-radius:3px;
    -o-border-radius:3px;
    border-radius:3px;
    background-color:#0cc;
    color:#fff;
    display:inline-block;
    height:28px;
    line-height:28px;
    text-align:center;
    width:72px;
    transition:background-color .2s linear 0s;
    border:none;
    cursor:pointer;
    margin:0 0 20px
}
.btn:hover {
    background-color:#f55;
    text-decoration:none
}
.ul\_pics li {
    position:relative;
    float:left;
    margin:5px;
    width:calc(100% / 6 - 10px);
    border:1px solid #ddd;
    text-align:center;
}
.ul\_pics li img {
    max-width:100%;
    max-height:100%;
}
.ul\_pics li p {
    position:absolute;
    bottom:0;
    overflow:hidden;
    margin:0;
    width:100%;
    background:#ddd;
    color:#fff;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.progress {
    position:absolute;
    top:45%;
    left:2%;
    margin:0;
    width:96%;
    background:#fff;
}
.bar {
    display:block;
    width:0;
    height:20px;
    background-color:#03A9F4;
}
.percent {
    position:absolute;
    top:0;
    left:45%;
    display:inline-block;
    color:#F44336;
    line-height:20px;
}
@media (max-width: 900px) {
    .ul\_pics li {
        width:calc(100% / 4 - 10px);
    }
}
@media (max-width: 600px) {
    .ul\_pics li {
        width:calc(100% / 3 - 10px);
    }
}

JS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
//判断内容页是否360收录
function haoso($url) {
	$url='https://www.so.com/s?a=index&q='.$url;
	$curl=curl\_init();
	curl\_setopt($curl,CURLOPT\_URL,$url);
	curl\_setopt($curl,CURLOPT\_RETURNTRANSFER,1);
	$rs=curl\_exec($curl);
	curl\_close($curl);
	if(!strpos($rs,'找不到')) {
		return 1;
	} else {
		return 0;
	}
}
function logurlhaoso($id) {
	$url=Url::log($id);
	if(haoso($url)==1) {
		echo "<a style=\"color:#1EA83A;
		\" rel=\"external nofollow\" title=\"点击查看!\" target=\"\_blank\" href=\"https://www.so.com/s?a=index&q=$url\">\[360已收录\]</a>";
	} else {
		echo "<a style=\"color:red;
		\" rel=\"external nofollow\" title=\"点击提交收录!\" target=\"\_blank\" href=\"http://info.so.com/site\_submit.html\">\[360未收录\]</a>";}}
		?>
坚持原创技术分享,您的支持将鼓励我继续创作!