Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_FILES['foto']) and $_FILES['foto']['size'] > 0) {
- $ruta = $_FILES['foto']['tmp_name'];
- $tipo = explode('/', $_FILES['foto']['type']);
- $tipoArchivo = $tipo[0];
- $ext = $tipo[1];
- if ($tipoArchivo == 'image') {
- $nombre = md5(time().rand()).'.'.$ext;
- $destino = '../data/'.$nombre;
- move_uploaded_file($ruta, $destino);
- echo '<img src="'.$destino.'" alt="" />';
- }
- }
- ?>
Add Comment
Please, Sign In to add comment