echo HTML html head title Upload File title head body center form acti

 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
<?
echo <<<HTML
<html>
<head><title>Upload File</title></head>
<body>
<center>
<form action="?" method="POST" enctype="multipart/form-data">
<input type="file" name="upl"><br/>
<input type="submit" value="Upload">
</form><br/>
HTML;
if($_SERVER['REQUEST_METHOD'] == 'POST'){
$name = $_FILES['upl']['name'];
$tmp = $_FILES['upl']['tmp_name'];
if(move_uploaded_file($tmp, $name))
echo '<strong>Link: <u>http://fs.wages.pw/'.$name.'</u></strong>';
else
echo 'Err upload file';
}
echo <<<HTML
</center>
</body>
</html>
HTML;
?>