note 130041 added to reserved.variables.files
| From: | pepguardiola@gmail.com | Date: | Tue, 18 Feb 2025 12:20:28 +0000 |
| Subject: | note 130041 added to reserved.variables.files | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221865@lists.php.net to get a copy of this message | ||
if (isset($_POST["enviar"])) {
// Creamos la condición para verificar que exista el archivo y para ver que no haya
errores.
if (isset($_FILES["archivo"]) &&
$_FILES["archivo"]["error"] == 0) {
// Ponemos la ruta actual de la imagen en este caso.
$rutatemporal = $_FILES["archivo"]["tmp_name"];
// Ponemos la ruta nueva de la imagen.
$destino = "img/" . $nombreArchivo . ".jpg";
// Movemos la imagen de la ruta temporal a la nueva ruta.
if (move_uploaded_file($rutatemporal, $destino)) {
echo "<p style = 'color: green'>El archivo se cargó
correctamente.</p>";
} else {
echo "<p style = 'color: red'>Hubo un error al cargar un
archivo.</p>";
}
} else {
echo "<p style = 'color: red'>Archivo no
válido.</p>";
}
// Sacamos la imagen por pantalla.
$foto = '<img src="img/' . $nombreArchivo . '.jpg"
alt="fotoPerfil">';
}
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 2a02:9130:9c25:7d17:3dc3:7fb8:45db:dfcf)
----
Manual Page -- https://php.net/manual/en/reserved.variables.files.php
Edit -- https://main.php.net/note/edit/130041
Del: integrated -- https://main.php.net/note/delete/130041/integrated
Del: useless -- https://main.php.net/note/delete/130041/useless
Del: bad code -- https://main.php.net/note/delete/130041/bad+code
Del: spam -- https://main.php.net/note/delete/130041/spam
Del: non-english -- https://main.php.net/note/delete/130041/non-english
Del: in docs -- https://main.php.net/note/delete/130041/in+docs
Del: other reasons-- https://main.php.net/note/delete/130041
Reject -- https://main.php.net/note/reject/130041
Search -- https://main.php.net/manage/user-notes.php