Ver Mensaje Individual
  #24 (permalink)  
Antiguo 18/11/2009, 10:44
Avatar de Distriker
Distriker
 
Fecha de Ingreso: marzo-2008
Ubicación: Las Palmas De Gran Canarias
Mensajes: 924
Antigüedad: 17 años
Puntos: 23
Respuesta: Not a valid MySQL result resource y fallo en una linea 3 pero no lo identi

Bien, muchas gracias a los dos , ya me aparece el formulario, aunque ahora tengo otro problemita, no me actua el botón de enviar, como resultado me han quedado estos archivos:

formulario.html

Código PHP:
<div width="90%" border="0">
<forn name="formulario" action="agregar.php" method="post">
<input type="hidden" name="identificador" value="<?php echo $id ?>">
Autor: <input type="text" name="autor"> <br />
Titulo: <input type="text" name="titulo" value="<?php echo $titulo ?>"> <br />
Mensaje <textarea name="mensaje" cols="50" rows="20"><?php echo $mensaje ?></textarea> <br />
<input type="submit" name="Submit" value="Enviar mensaje">
</form>
agregar.php

Código PHP:
<?php
require ('configuracion.php') ;
$autor $_POST ["autor"] ;
$titulo $_POST ["titulo"] ;
$mensaje $_POST ["mensaje"] ;
$identificador $_POST ["identificador"] ;

if (
$autor == "" or $titulo == "" or $mensaje == "") {
  echo 
'Complete el formulario' ;

$sql "INSERT INTO foro (autor, titulo, mensaje, identificador, fecha, ultima-respuesta) " ;
$sql.= "VALUES ('$autor', '$titulo', '$mensaje', '$identificador', NOW(),NOW())" ;
$rs mysql_query ($conectar$sql) or die("Error al grabar el mensaje: ".mysql_error) ;
$ult_id mysql_insert_id ($conectar) ;

if (!empty(
$identificador))
{
$sql "UPDATE foro SET respuestas=respuestas+1, ultima-respuesta=NOW()" ;
$sql.= " WHERE id = '$identificador'" ;
$rs mysql_query ($conectar$sql) ;
Header ("Location: foro.php?id=$identificador#ult_id") ;
exit () ;
}
Header ("Location index.php") ;
?>
temas.html

Código PHP:
<div width="90%" border="0" align="center" bgcolor="<?php=$color?>">

    <div><a href="foro.php?id=<?=$id?>">

      <?php=$titulo?>

      </a></div>

    <div width="15%" align="center"><font size="-2">Por <b> 

      <?php=$autor?>

      </b><br>

      el 

      <?php=$fecha?>

      </font></div>

    <div width="15%" align="center"><font size="-2"> 

      <?php=$respuestas?>

      </font></div>

    <div width="15%" align="center"><font size="-2"> 

      <?php=$ult_respuesta?>

      </font></div>

</div>
</div>
funciones.php

Código PHP:
<?php
function mostrartemplate($tema$variables)

{

    
extract($variables);

    eval(
"?>$tema");

}



function 
parsearTags($mensaje)

{

    
$mensaje str_replace("[citar]""<blockquote><hr width='100%' size='2'>"$mensaje);

    
$mensaje str_replace("[/citar]""<hr width='100%' size='2'></blockquote>"$mensaje);

    return 
$mensaje;

}

?>
Si necesitáis alguno mas avisad .

Yo mientras voy a ir a intentar descubrir el error.

Saludos
__________________
Si no te quejas, nunca conseguiras nada, pero si te quejas siempre lo perderás todo.
Una mala acción da fruto a un mal Karma.