Tengo el formulario:
Código HTML:
<form id='formulario' action="altaPersona.php" method="post"> Nombre: <input style="border:1px solid" type="text" name="nombre"> <br><br> Imagen: <input id="imagen" type="file" name="imagen" style="border:1px solid" size="40"> <br> <br> <input type="submit" name="enviar" value="Crear"> </form>
Código PHP:
<?php
require('conectar.php');
$nombre=$_POST['nombre'];
$imagen=$_FILES['imagen']['name'];
$sql="INSERT INTO persona (id, nombre, imagen
VALUES (NULL, '".$nombre."', '".$imagen."')";
$result=mysql_query($sql,$conection);
copy($_POST['imagen'], "imagenes/".$_POST['imagen']);
?>
Gracias