Código:
¿Que error puedo tener? <? $servidor = "localhost"; $usuario = ""; $contrasenia = ""; $cnx = mysql_connect($servidor,$usuario,$contrasenia) or die(mysql_error()); mysql_select_db("guiamusica_bd",$cnx) or die (mysql_error()); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Documento sin título</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } .cwe { font-family: HandelGotDLig; font-size: 12px; color: #000000; border: 1px outset #000000; } .boton { font-family: HandelGotDLig; font-size: 12px; font-weight: bold; color: #FFFFFF; background-image: url(../imagenes/fondo%20botones.jpg); background-repeat: no-repeat; background-position: center center; } --> </style> <script language="JavaScript" type="text/javascript" src="wysiwyg.js"> </script> </head> <body> <form id="form1" name="form1" method="post" action=""> <table width="800" border="0"> <? $titulo = $_GET["titulo"]; $consulta = "SELECT * FROM noticias WHERE titulo='$titulo'"; $query = mysql_query($consulta) or die (mysql_error()); $filas = mysql_num_rows($query); if($filas>0) { while($res = mysql_fetch_array($query)) { ?> <tr> <td width="388" class="cwe"><div align="right">Fecha</div></td> <td width="402"><label> <input name="fecha" type="text" class="cwe" id="textfield" size="85" value="<? echo date("d/m/Y"); ?>"/> </label></td> </tr> <tr> <td class="cwe"><div align="right">Titulo</div></td> <td><input name="titulo" type="text" class="cwe" id="textfield2" size="85" value="<? echo $res["titulo"]; ?>" /></td> </tr> <tr> <td class="cwe"><div align="right">Subtitulo</div></td> <td><input name="subtitulo" type="text" class="cwe" id="textfield3" size="85" value="<? echo $res["subtitulo"]; ?>" /></td> </tr> <tr> <td colspan="2" class="cwe"> <div align="center"> <textarea name="test1" id="textarea1" cols="45" rows="5"><? echo $res["noticia"]; ?></textarea> <script language="JavaScript1.2" type="text/javascript"> generate_wysiwyg('textarea1'); </script> </div> </td> </tr> <tr> <td colspan="2"> <div align="center"> <input name="submit" type="submit" class="boton" id="button" value="Guardar Cambios" /> </div> </td> </tr> <? } } else { echo "No hay noticias de este artista"; } ?> <? if(isset($_POST["submit"])) { $titulo = $_GET["titulo"]; $texto = $_POST["test1"]; $consultab = "UPDATE noticias SET id_noti='',noticia='$texto' WHERE titulo='$titulo'"; $queryb = mysql_query($consultab) or die (mysql_error()); echo "Editado"; } ?> </table> </form> </body> </html> <? mysql_close($cnx); ?>