Autor Tema: [AYUDA] Este código no me actúa  (Leído 454 veces)

Desconectado JuankoX

  • PHPer@ Fijo
  • ***
  • Mensajes: 161
  • Karma: 2
  • Sexo: Masculino
  • ¿Me agregas a MSN? =)
    • Ver Perfil
[AYUDA] Este código no me actúa
« en: 14 de Enero de 2008, 16:37:08 pm »
El código no me actúa, al presionar el formulario no actúa en el servidor, se queda en la página;

<!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=iso-8859-1" />



<
title>Enviar noticia Noticias mixers</title>



<
style type="text/css">



<!--



body,td,th {



	
font-familyVerdanaArialHelveticasans-serif;



	
font-size10px;



	
color#000000;



}



.
Estilo1 {



	
color#CC0000;



	
font-weightbold;



}



a:link {



	
color#DA5903;



}



a:visited {



	
color#DA5903;



}



a:hover {



	
color#DA5903;



}



a:active {



	
color#DA5903;



}
.
Estilo2 {
	
color#FF0000;
	
font-weightbold;
}
.
Estilo4 {color#CC0000}
.Estilo6 {color#000000}



-->



</
style></head>







<
body>



<
p>

  <
script language="JavaScript" type="text/javascript" src="click.js"></script>
  
  
  
</p>
<table width="98" border="0" align="center" cellpadding="0" cellspacing="0">



  <tr>



    <td width="98"><img src="img/news_arriba_mix.gif" width="241" height="40" /></td>


  </tr>



  <tr>



    <td background="img/news_centro_mix.gif" style=""><table width="230" height="36" border="0" align="center" cellpadding="3" cellspacing="0">



      <tr>



        <td width="215"><p><strong>22-11-07</strong> <span class="Estilo4"><strong><strong>Enviar noticias</strong><b><img src="img/new.gif" width="21" height="9" /></b><br />
        </strong><span class="Estilo6"> Enviar noticias del sistema. <br> Autor: <br><input type="text" name="autor"><br>Email del autor: <br> <input type="text" name="autormail"><br>Titulo de la noticia: <br> <input type="text" name="titulo"><br>Noticia: <br> <textarea name="noticiaescrita"></textarea><br><input type="submit" value="Enviar noticia" name="enviar"><br><br>
<?
include("conectar.php");
$autor $_POST[&#39;autor&#39;];
$titulo $_POST[&#39;titulo&#39;];
$autormail $_POST[&#39;autoramail&#39;];
$noticiaescrita $_POST[&#39;noticiaescrita&#39;];
$fecha date("d-m-Y");
$noticia = &#39;<td width="215"><p><strong>&#39; .$fecha. &#39; enviada por <b><a href=&#39;.$autormail.&#39;>&#39;.$autor. &#39; </strong> <span class="Estilo4"><strong><strong>&#39; .$titulo. &#39; </strong><b><img src="img/new.gif" width="21" height="9" /></b><br /></strong>&#39;;
$noticia .= &#39;<span class="Estilo6">&#39; .$noticiaescrita. &#39;</p>&#39;;
$noticia .= &#39;<br><br>&#39;;
$sql "INSERT INTO `noticiasmix` (noticia) VALUES (&#39;".$noticia."&#39;);";
if(
$_POST[&#39;enviar&#39;]) {
if(mysql_query($sql)) {
echo 
"Noticia enviada con éxito!";
} else {
echo 
"La noticia no se pudo enviar.";
}
}
?><br><br><br>

          <p align="center">Sistema noticias en php by <strong>JuankoX</strong> <br />



            Administraci&oacute;n</p></td>
      </tr>


    </table></td>



  </tr>



  <tr>



    <td><img src="img/news_abajo_mix.gif" width="241" height="11" /></td>



  </tr>



</table>



</body>


</html>


HELP ME! IT'S TOO URGENTE!


MODIFICADO:
Perdón, ya lo solucioné, olvidé ponerle el formulario al código, pueden cerrar el tema  ;)
« Última modificación: 14 de Enero de 2008, 17:03:50 pm por JuankoX »

Comunidad PHPeros

[AYUDA] Este código no me actúa
« en: 14 de Enero de 2008, 16:37:08 pm »

Desconectado CarlosRdrz

  • Moderador Global
  • PHPero Master
  • *****
  • Mensajes: 2.505
  • Karma: 131
  • Sexo: Masculino
  • A.k.a. TLX
    • Ver Perfil
Re: [AYUDA] Este código no me actúa
« Respuesta #1 en: 14 de Enero de 2008, 17:04:30 pm »
Le falta abrir la etiqueta form donde se especifica el archivo que procesara el formulario (¿O piensas que el codigo es adivino? :P) Y cuando la pongas tendrias tambien que cerrarla al finalizar el form.

EDITADO: No lei la negrita vaya :P

Saludos
La dedicación de mi respuesta sera directamente proporcional a la dedicación de tu pregunta.
Hacer códigos que entiendan las máquinas es fácil, lo difícil y realmente útil es hacer códigos que entiendan las personas.
http://twitter.com/CarlosRdrz
http://www.carlosrdrz.es