.


:




:

































 

 

 

 


2. upload.php




. HTML- index.html upload.php . , 1.

1. HTML- () index.html)

<html>

<head> <title </title> </head>

<body> <h2><b> </b></h2>

<form action="upload.php" method="post" enctype="multipart/form-data">

<input type="file" name="filename"><br>

<input type="submit" value="3arpy"><br>

</form> </body>

</html>

entype , . , entype

Quot;multipart/form-data".

"application/x-www-form-urlencoded".

, , . 1.

HTTP-, , , , php.ini ( upload_tmp_dir).

$_files.

:

□ $_FILES["filename"] ["name"] ;

□ $_files["filename"] ["size"] ;

□ $_files [ "filename" ] [ "type" ] ;

$_FILES["filename"] ["tmp_name"] , .

2 upload.php, temp.

2. upload.php

<html> <head>

<title> </title> </head> <body> <?php

if(copy($_FILES["filename"]["tmp_name"], "temp/".$_FILES["filename"]["name"])) {

echo(" "); }

else {

echo(" "); }

</body> </html>

temp , , " ".

()

is_uploaded_file(), ($_FILES["filename"] ["name"]) true false .

3 . 2.





:


: 2016-12-04; !; : 459 |


:

:

- , .
==> ...

1915 - | 1715 -


© 2015-2024 lektsii.org - -

: 0.012 .