Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/09/2011, 08:42
thedarking
 
Fecha de Ingreso: julio-2011
Ubicación: Argentina
Mensajes: 38
Antigüedad: 12 años, 9 meses
Puntos: 0
Pregunta Duda php isset

como hago para q si esta la url de la imagen ya en la db
la sobreescriba? desde la pagina en php
y q escriba la direccion de donde la carge...??

aki los ejemplos q tngo

Código PHP:
<html>
    <head>
        <title>Modificacion de usuario</title>
    </head>
<body>
<?php
require_once('../cnx.php');
$id=$_POST['id'];
$result=mysql_query("select * from futbol_equipo",$cnx);

while (
$row=mysql_fetch_array($result)) {
?>
<form name="futbol_equipo" action="action-modificar.php" method="POST" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?php echo $row[0]?>" />

<table border="1">
<tr>
<td><b>Equipo:</b></td>
<td><b>Logo</b></td>
</tr>
<tr>
<td><input type="text" name="equipo" value="<?php echo $row[1]?>" /></td>
<td><img src="<?php echo $row[2]?>" height="100" width="100"><input type="file" name="logo"></td>
</tr>
</table>

<br />
<p />
        
<input name="enviar" type="submit" value="Modificar"><p>
</form>

    <a href="borrar.php?id=<?php echo $row[0]?>"><button>borrar</button></a><p />
    <hr />
    <p />

<?php ?>


<h1>En Construcci&oacute;n</h1><br />
<center>
    <a href="./equipos.html"><button>Volver al &Iacute;ndice</button></a>
</center>

</body>
</html>
Código PHP:
<?php
require_once('../cnx.php');
$id=$_POST['id'];
$equipo $_POST['equipo'];
$logo $_POST['logo'];
$query="UPDATE `Base de datos`.`futbol_equipo` SET `equipo` = '$equipo', `logo` = '$logo' WHERE `futbol_equipo`.`id` = $id ";
$result=mysql_query($query);




?> 
<html>
<body>
<center>
    <a href="./modificar.php"><button>Volver a Modificaciones</button></a><p />
    <a href="./equipos.html"><button>Volver al &iacute;ndice</button></a>
</center>
</body>
</html>
Gracias x la orientacion :)