Foros del Web » Programación para mayores de 30 ;) » Bases de Datos General » Mysql »

Modificar imagen de la base de datos y de su directorio

Estas en el tema de Modificar imagen de la base de datos y de su directorio en el foro de Mysql en Foros del Web. Este es el administrador <table width="400" align="center"> <tr class="encabezado"> <td valign="top" align="center" width="400"> Titulo</td> <td valign="top" align="center" width="100"> Texto</td> <td valign="top" align="center" width="100"> Imagen</td> <td ...
  #1 (permalink)  
Antiguo 14/05/2010, 13:26
 
Fecha de Ingreso: mayo-2010
Mensajes: 32
Antigüedad: 13 años, 11 meses
Puntos: 0
Modificar imagen de la base de datos y de su directorio

Este es el administrador

<table width="400" align="center">

<tr class="encabezado">
<td valign="top" align="center" width="400">
Titulo</td>
<td valign="top" align="center" width="100">
Texto</td>
<td valign="top" align="center" width="100">
Imagen</td>
<td valign="top" align="center" width="25">&nbsp;</td>
<td valign="top" align="center" width="25">&nbsp;</td>
</tr>

<?php
$sql="select * from noticias";
$res=mysql_query($sql,$con);
while ($reg=mysql_fetch_array($res))
{
?>

<tr class="registros">
<td valign="top" align="center" width="400">
<?php
echo chao_tilde($reg["titulo"]);
?>
</td>
<td valign="top" align="center" width="100">
<?php
echo $reg["texto"];
?>
</td>
<td valign="top" align="center" width="100">
<?php
echo $reg["imagen"];
?>
</td>
<td valign="top" align="center" width="25">
<a href="noticias/modificar.php?id=<?php echo $reg["id"];?>" title="Modificar"><img src="noticias/ima/editar.png" border="0"></a></td>
<td valign="top" align="center" width="25">
<a href="javascript:void(0)" title="Eliminar" onClick="eliminar('<?php echo $reg["id"];?>')"><img src="noticias/ima/eliminar.png" border="0"></a></td>
</tr>
<?php
}
?>
<tr>
<td valign="top" align="right" width="400" colspan="5">
<a href="noticias/agregar.php" title="Agregar Empelados"><img src="noticias/ima/add48x48.png" width="24" height="24" border="0"></a></td>
</tr>
</table>


Este es el archivo modificar.php

<?php
require_once("conexion.php");
$sql="select * from noticias where id=".$_GET["id"]."";
$res=mysql_query($sql,$con);
?>

<html>
<head>
<title>Modificar Noticia</title>
<script language="javascript" type="text/javascript" src="js/funciones.js"></script>
</head>

<body onLoad="limpiar()">
<?php
if ($reg=mysql_fetch_array($res))
{
?>

<form action="edit.php" method="post" enctype="multipart/form-data" name="form">
<table align="center" width="400">
<tr>
<td valign="top" align="center" width="400" colspan="2">
<h3>Modificar Noticia</h3>
</td>
</tr>

<tr>
<td align="right" valign="top" width="200">
Titulo
</td>
<td valign="top" align="left" width="200">
<input type="text" name="titulo" value="<?php echo $reg["titulo"];?>" />
</td>
</tr>

<tr>
<td align="right" valign="top" width="200">
Texto
</td>
<td valign="top" align="left" width="200">
<input type="text" name="texto" value="<?php echo $reg["texto"];?>" />
</td>
</tr>

<tr>
<td align="right" valign="top" width="200">
Imagen
</td>
<td valign="top" align="left" width="200"><label>
<input name="imagen" type="file" id="imagen" value="<?php echo $reg["imagen"];?>">
</label></td>
</tr>

<tr>
<td valign="top" align="center" width="400" colspan="2">
<input type="hidden" name="id" value="<?php echo $_GET["id"];?>">
<input type="button" value="Volver" title="Volver" onClick="history.back();" />
&nbsp;&nbsp;||&nbsp;&nbsp;
<input name="Enviar" type="submit" title="Modificar" value="Modificar" />
</td>
</tr>

</table>
</form>
<?php
}
?>

</body>
</html>


Este es el archivo edit.php

Aca se me enredo todo

<?php
//print_r($_POST);
require_once("conexion.php");

$sql="update noticias
set
titulo='".$_POST["titulo"]."',
texto='".$_POST["texto"]."',
where
id=".$_POST["id"]."";
//echo $sql;
$res=mysql_query($sql,$con);
echo "<script type=''>
alert('Los datos del empleado fueron modificados correctamente');
window.location='index.php';
</script>
";
//if (isset($_FILES['archivo']['name']) && !empty($_FILES['archivo']['name']))
?>


Tambien tengo problemas al eliminar, pero eso lo vemos despues.
  #2 (permalink)  
Antiguo 14/05/2010, 13:40
Avatar de gnzsoloyo
Moderador criollo
 
Fecha de Ingreso: noviembre-2007
Ubicación: Actualmente en Buenos Aires (el enemigo ancestral)
Mensajes: 23.324
Antigüedad: 16 años, 4 meses
Puntos: 2658
Respuesta: Modificar imagen de la base de datos y de su directorio

Y este es el foro donde deberías preguntar por estas cosas:
Foro de PHP

Este es el foro de Dases de Datos... No confundas los íconos de link a otro foro () con los de subforos ()

__________________
¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores constantemente...
"El problema es la interfase silla-teclado." (Gillermo Luque)
  #3 (permalink)  
Antiguo 14/05/2010, 14:10
 
Fecha de Ingreso: mayo-2010
Mensajes: 32
Antigüedad: 13 años, 11 meses
Puntos: 0
Respuesta: Modificar imagen de la base de datos y de su directorio

disculpa no soy de publicar en foros, lo elimino, saludos
  #4 (permalink)  
Antiguo 14/05/2010, 14:11
 
Fecha de Ingreso: mayo-2010
Mensajes: 32
Antigüedad: 13 años, 11 meses
Puntos: 0
Respuesta: Modificar imagen de la base de datos y de su directorio

mm.. jej no se como

Etiquetas: directorio, modificar
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:31.