martes, 11 de febrero de 2014

subir ficheros PHP $HTTP_POST_FILES está deprecated

//***************** index.php

<html>
<body>

<form action="insert.php" method="post" enctype="multipart/form-data">
Foto:
<input type="file" name="foto" id="foto"><br>
<input type="submit" name="submit" value=" SUBIR ">
</form>

</body>
</html>


//**************** insert.php

<?php
if ($_FILES["foto"]["error"] > 0)
  {
  echo "Error: " . $_FILES["foto"]["error"] . "<br>";
  }
else
  {
  echo "Subir: " . $_FILES["foto"]["name"] . "<br>";
  echo "Tipo: " . $_FILES["foto"]["type"] . "<br>";
  echo "Tamaño: " . ($_FILES["foto"]["size"] / 1024) . " kB<br>";
  echo "Servidor: " . $_FILES["foto"]["tmp_name"];
  }
?>




.