editar.php
Código PHP:
<form action="editarl.php" method="post">
<p> </p>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="img/juego/spacer.gif" width="32" height="1" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="88" height="1" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="14" height="1" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="52" height="1" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="93" height="1" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="15" height="1" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="79" height="1" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="27" height="1" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td colspan="8"><img name="juegod_r1_c1" src="img/juego/juegod_r1_c1.gif" width="400" height="85" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="1" height="85" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="10"><img name="juegod_r2_c1" src="img/juego/juegod_r2_c1.gif" width="32" height="284" border="0" alt=""></td>
<td colspan="5" background="img/juego/juegod_r2_c2.jpg"><div align="center">
<input type="text" name="nombre" size="35" style="border:0px; font-size:12px; background-image:url(img/juego/juegod_r2_c2.jpg); width:262px; height:24px">
</div></td>
<td rowspan="4" colspan="2"><img name="juegod_r2_c7" src="img/juego/juegod_r2_c7.gif" width="106" height="137" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="1" height="24" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5"><img name="juegod_r3_c2" src="img/juego/juegod_r3_c2.gif" width="262" height="44" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="1" height="44" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5" background="img/juego/juegod_r4_c2.jpg"><div align="center">
<input type="text" name="imagen" size="35" style="border:0px; font-size:12px; background-image:url(img/juego/juegod_r4_c2.jpg); width:262px; height:24px">
</div></td>
<td><img src="img/juego/spacer.gif" width="1" height="25" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5"><img name="juegod_r5_c2" src="img/juego/juegod_r5_c2.gif" width="262" height="44" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="1" height="44" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="6"><img name="juegod_r6_c2" src="img/juego/juegod_r6_c2.gif" width="88" height="147" border="0" alt=""></td>
<td colspan="5" background="img/juego/juegod_r6_c3.jpg"><div align="center">
<input type="text" name="link" size="35" style="border:0px; font-size:12px; background-image:url(img/juego/juegod_r6_c3.jpg); width:253px; height:24px">
</div></td>
<td rowspan="6"><img name="juegod_r6_c8" src="img/juego/juegod_r6_c8.gif" width="27" height="147" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="1" height="24" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5"><img name="juegod_r7_c3" src="img/juego/juegod_r7_c3.gif" width="253" height="44" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="1" height="44" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="4"><img name="juegod_r8_c3" src="img/juego/juegod_r8_c3.gif" width="14" height="79" border="0" alt=""></td>
<td colspan="4" background="img/juego/juegod_r8_c4.jpg"><div align="center">
<input type="text" name="guia" size="35" style="border:0px; font-size:12px; background-image:url(img/juego/juegod_r8_c4.jpg); width:239px; height:24px">
</div></td>
<td><img src="img/juego/spacer.gif" width="1" height="26" border="0" alt=""></td>
</tr>
<tr>
<td colspan="4"><img name="juegod_r9_c4" src="img/juego/juegod_r9_c4.gif" width="239" height="12" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="1" height="12" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2"><img name="juegod_r10_c4" src="img/juego/juegod_r10_c4.gif" width="52" height="41" border="0" alt=""></td>
<td background="img/juego/juegod_r10_c5.jpg"><div align="center">
<input type="submit" name="enviar" value="." style="background-image:url(img/juego/juegod_r10_c5.jpg); width:93px; height:32px; border:0px; color:#FFFFFF">
</div></td>
<td rowspan="2" colspan="2"><img name="juegod_r10_c6" src="img/juego/juegod_r10_c6.gif" width="94" height="41" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="1" height="32" border="0" alt=""></td>
</tr>
<tr>
<td><img name="juegod_r11_c5" src="img/juego/juegod_r11_c5.gif" width="93" height="9" border="0" alt=""></td>
<td><img src="img/juego/spacer.gif" width="1" height="9" border="0" alt=""></td>
</tr>
</table>
<p align="center"> </p><center>
<?php
$d_host = ""; // MySQL server host
$d_port = ""; // MySQL server port
$d_user = "camilomw_mw"; // MySQL username
$d_pass = "abc123"; // MySQL password
$db_name = "camilomw_mw";
//La conexión
$coneccion = mysql_connect($d_host,$d_user,$d_pass) or die ('No se Puede Conectar a la Base de Datos, ya que: ' . mysql_error());
mysql_select_db($db_name,$coneccion);
//selección de la base de datos con la que vamos a trabajar
mysql_select_db("juegodia");
$sSQL="Select juego From juegodia Order By juego";
$result=mysql_query($sSQL);
echo '<select name="juego" style="border=0">';
//Generamos el menu desplegable
while ($row=mysql_fetch_array($result))
{echo '<option>'.$row["juego"];}
mysql_query($sql,$coneccion);
mysql_close($coneccion);
?>
</form>
editarl.php
Código PHP:
<?php
$d_host = "fdb1.awardspace.com"; // MySQL server host
$d_port = "3306"; // MySQL server port
$d_user = "camilomw_mw"; // MySQL username
$d_pass = "abc123"; // MySQL password
$db_name = "camilomw_mw";
//La conexión
$coneccion = mysql_connect($d_host,$d_user,$d_pass) or die ('No se Puede Conectar a la Base de Datos, ya que: ' . mysql_error());
mysql_select_db($db_name,$coneccion);
# se recogen los datos del formulario
$nombre = $_POST['nombre'];
$imagen = $_POST['imagen'];
$link = $_POST['link'];
$guia = $_POST['guia'];
//Insertando en la base de datos
$sql="Update juegodia (Set nombre='$nombre', imagen='$imagen', link='$link', guia='$guia' Where juego='Juego del Dia')";
mysql_query($sql,$coneccion);
mysql_close($coneccion);
?>