Cita:
esta es mi php<html>
<head>
<title>Agregar Propìedad</title>
</head>
<body>
<form mothod="post" action="agregar.php" enctype="multipart/form-data">
<label><b>Nombre de la propiedad:</b></label><br>
<input type="text" size="80" maxlength="80" name="titulo"/><br>
<label><b>Tipo de propiedad:</b></label><br>
<input type="radio" name="tipoi" value="Apartamento" />Apartamento
<input type="radio" name="tipoi" value="Casa" />Casa
<input type="radio" name="tipoi" value="Bodega" />Bodega
<input type="radio" name="tipoi" value="Finca" />Finca
<input type="radio" name="tipoi" value="Lote" />Lote<br>
<label><b>Descripcion:</b></label><br>
<textarea cols="80" rows="5" name="descrip"></textarea><br>
<label><b>Ubicacion:</b></label><br>
<input type="text" name="ubicacion"/><br>
<label><b>Valor De La Propieda:</b></label><br>
<input type="text" name="precio" /><br>
<label><b>Habitaciones:</b></label><br>
<input type="text" size="2" maxlength="2" name="habitaciones"/><br>
<label><b>Baños:</b></label><br>
<input type="text" size="2" maxlength="2" name="banos"/><br>
<label><b>Garages:</b></label><br>
<input type="text" size="2" maxlength="2" name="garage"/><br><br>
<label><b>Seccion De Galeria:</b></label><br><br>
<label>Elige Una Imagen Principal:</label><br>
<input type="file" size="80" maxlength="80" name="imagen1"><br>
<label>Segunda Imagen:</label><br>
<input type="file" size="80" maxlength="80" name="imagen2"><br>
<label>Tercera Imagen:</label><br>
<input type="file" size="80" maxlength="80" name="imagen3"><br>
<label>Cuarta Imagen:</label><br>
<input type="file" size="80" maxlength="80" name="imagen4"><br>
<label>Quinta Imagen:</label><br>
<input type="file" size="80" maxlength="80" name="imagen5"><br>
<label>Sexta Imagen:</label><br>
<input type="file" size="80" maxlength="80" name="imagen6"><br>
<input type="submit" value="Agregar Propiedad">
</form>
</body>
</html>
<head>
<title>Agregar Propìedad</title>
</head>
<body>
<form mothod="post" action="agregar.php" enctype="multipart/form-data">
<label><b>Nombre de la propiedad:</b></label><br>
<input type="text" size="80" maxlength="80" name="titulo"/><br>
<label><b>Tipo de propiedad:</b></label><br>
<input type="radio" name="tipoi" value="Apartamento" />Apartamento
<input type="radio" name="tipoi" value="Casa" />Casa
<input type="radio" name="tipoi" value="Bodega" />Bodega
<input type="radio" name="tipoi" value="Finca" />Finca
<input type="radio" name="tipoi" value="Lote" />Lote<br>
<label><b>Descripcion:</b></label><br>
<textarea cols="80" rows="5" name="descrip"></textarea><br>
<label><b>Ubicacion:</b></label><br>
<input type="text" name="ubicacion"/><br>
<label><b>Valor De La Propieda:</b></label><br>
<input type="text" name="precio" /><br>
<label><b>Habitaciones:</b></label><br>
<input type="text" size="2" maxlength="2" name="habitaciones"/><br>
<label><b>Baños:</b></label><br>
<input type="text" size="2" maxlength="2" name="banos"/><br>
<label><b>Garages:</b></label><br>
<input type="text" size="2" maxlength="2" name="garage"/><br><br>
<label><b>Seccion De Galeria:</b></label><br><br>
<label>Elige Una Imagen Principal:</label><br>
<input type="file" size="80" maxlength="80" name="imagen1"><br>
<label>Segunda Imagen:</label><br>
<input type="file" size="80" maxlength="80" name="imagen2"><br>
<label>Tercera Imagen:</label><br>
<input type="file" size="80" maxlength="80" name="imagen3"><br>
<label>Cuarta Imagen:</label><br>
<input type="file" size="80" maxlength="80" name="imagen4"><br>
<label>Quinta Imagen:</label><br>
<input type="file" size="80" maxlength="80" name="imagen5"><br>
<label>Sexta Imagen:</label><br>
<input type="file" size="80" maxlength="80" name="imagen6"><br>
<input type="submit" value="Agregar Propiedad">
</form>
</body>
</html>
Cita:
Pero solo me guarda el id y el campo de la tabla imagen1 solo me sale img/<?php
$conexion=mysql_connect('localhost','root','') or die('No hay conexion ala base de datos');
$db=mysql_select_db('bienes',$conexion)or die('no existe la base de datos');
$ruta='img';
$rutaTemporal=$_FILES['imagen1']['tmp_name'];
$nombreImagen=$_FILES['imagen1']['name'];
$rutaDestino=$ruta.'/'.$nombreImagen;
move_uploaded_file($rutaTemporal,$rutaDestino);
$titulo=$_POST['titulo'];
$tipo=$_POST['tipoi'];
$desc=$_POST['descrip'];
$area=$_POST['ubicacion'];
$valor=$_POST['precio'];
$cuartos=$_POST['habitaciones'];
$ban=$_POST['banos'];
$gara=$_POST['garage'];
$sql="INSERT INTO inmueble (nombre,tipo,descripcion,area,precio,habitaciones, banos,garage,imagen1) values('".$titulo."','".$tipo."','".$desc."','".$a rea."','".$valor."','".$cuartos."','".$ban."','".$ gara."','".$rutaDestino."')";
$res=mysql_query($sql,$conexion);
if ($res){
echo 'insercion con exito';
}else{ 'no se puedo insertar';
}
?>
$conexion=mysql_connect('localhost','root','') or die('No hay conexion ala base de datos');
$db=mysql_select_db('bienes',$conexion)or die('no existe la base de datos');
$ruta='img';
$rutaTemporal=$_FILES['imagen1']['tmp_name'];
$nombreImagen=$_FILES['imagen1']['name'];
$rutaDestino=$ruta.'/'.$nombreImagen;
move_uploaded_file($rutaTemporal,$rutaDestino);
$titulo=$_POST['titulo'];
$tipo=$_POST['tipoi'];
$desc=$_POST['descrip'];
$area=$_POST['ubicacion'];
$valor=$_POST['precio'];
$cuartos=$_POST['habitaciones'];
$ban=$_POST['banos'];
$gara=$_POST['garage'];
$sql="INSERT INTO inmueble (nombre,tipo,descripcion,area,precio,habitaciones, banos,garage,imagen1) values('".$titulo."','".$tipo."','".$desc."','".$a rea."','".$valor."','".$cuartos."','".$ban."','".$ gara."','".$rutaDestino."')";
$res=mysql_query($sql,$conexion);
if ($res){
echo 'insercion con exito';
}else{ 'no se puedo insertar';
}
?>
vi varios ejemplos que asi salian yo solo le agregue mas datos espero que me puedan orientar un saludo a todos