Home >> PHP >> $_FILES super global variable in PHP

$_FILES super global variable in PHP

$_FILES  used to upload file on server.

<?php

if(isset($_POST['submit'])){

      $image=$_FILES['image']['name'];

      $tmp_image=$_FILES['image']['tmp_name'];

      move_uploaded_file($tmp_image,'images/'.$image);

}

?>

<form name="register" method="post" action="" enctype="multipart/form-data">  

         Image <input type="file" name="image">

         <input type="submit" name="submit" value="Submit">

</form>

Post Your Comment

Next Questions
$_ENV super global variable
$_COOKIE super global variable
$_SESSION super global variable
Ternary operator
Variable types
What is password encrypt and decrypt function
Difference between echo and print
How can destroy and unset the variable of a session
Function
isset() function
unset() function
empty() function
What are function for controlling script execution
exit() function
die() function
fun_num_args() function
ereg_replace() function
ereg_ireplace() function
preg_match() function
preg_replace() function
File handling
fopen() function
fclose() function
fread() function
create the file

Copyright ©2022 coderraj.com. All Rights Reserved.