
07/03/2007, 20:50
|
| | Fecha de Ingreso: diciembre-2005
Mensajes: 46
Antigüedad: 19 años, 3 meses Puntos: 0 | |
Re: No puedo subir fotos a mi base de datos ---perdon por la demora
---aqui esta el codigo completo que me funcionaba anteriormente---
<?php require_once('../Connections/notasremar.php'); ?>
<?php
$base=$database_notasremar;
$tabla="tgaleria";
//$txtfoto=$_POST[txtfoto];
$leyenda =$_POST[txtleyenda];
$estado=$_POST[txtestado];
//----------inicio de foto
$newtxtfoto = sprintf ("../imag_gale/%s",$txtfoto_name);
move_uploaded_file ($txtfoto,$newtxtfoto);
//-------------------fin de foto
$conexion=mysql_connect($hostname_notasremar,$user name_notasremar,$password_notasremar);
mysql_select_db($base,$conexion);
mysql_query("INSERT $tabla (foto,leyenda,estado) VALUES ('$txtfoto_name','$leyenda','$estado')",$conexion) ;
if (mysql_errno($conexion)==0){
$mensaje_registro= "<span class=txt_titulo02>La Nota se ha agreagado correctamente</span>";
}
else{
if (mysql_errno($conexion)==1062){
$mensaje_registro= '<span class="contenidos2">No se ha podido ingresar la Nota</span></a>';
}else{
$numerror=mysql_errno($conexion);
$descrerror=mysql_error($conexion);
$mensaje_registro= "<span class=txt_titulo02>Se ha producido un error Nº $numerror que corresponde a: $descrerror <br></span>";
}
}
# cerramos la conexion
mysql_close();
?>
--- aqui esta el formulario ---
<form action="gale_ingreso_ok.php" method="post" enctype="multipart/form-data" name="galeform" id="galeform">
<table width="550">
<tr bgcolor="#FFCC00">
<th width="30%" scope="row">Foto : </th>
<td class="cuerpo"><input name="txtfoto" type="file" id="txtfoto"></td>
</tr>
<tr bgcolor="#FFCC00">
<th width="30%" scope="row">Leyenda : </th>
<td><textarea name="txtleyenda" cols="40" rows="5" id="txtleyenda"></textarea></td>
</tr>
<tr bgcolor="#FFCC00">
<th width="30%" scope="row">Estado : </th>
<td class="cuerpo"><input name="txtestado" type="text" id="txtestado" size="30" maxlength="30"></td>
</tr>
<tr bgcolor="#FFCC00">
<th width="30%" scope="row"> </th>
<td class="cuerpo"><input name="ingresar" type="submit" id="ingresar" onClick="MM_validateForm('txtestado','','R','txtle yenda','','R');return document.MM_returnValue" value="Ingresar"></td>
</tr>
</table>
</form>
Bueno--- es todo lo que tengo---
puede ser mas facil otro codigo que ver que falla en este-- alguien tiene otro codigo???
gracias--- |