Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/12/2011, 21:17
Avatar de cuervo699
cuervo699
 
Fecha de Ingreso: febrero-2011
Mensajes: 104
Antigüedad: 13 años, 3 meses
Puntos: 7
Problema con envio de mensaje en php

Tengo el siguiente codigo, que gestiona el envio y recibo de mensajes, a traves de php&mysql lo encontre en www.cesarcancino.com pero no entiendo porque no me funciona la parte del input destinario y el input asunto...

lanza un error en la linea 96 y 100
no entiendo porq, aqui les dejo el zip con los archivos

Código PHP:
<?php 
session_start
();
include(
"conexion.php"); 

//redireccionar si no inicia sesion
if(!isset($_SESSION['usuario']))
{
    
header("Location: index.php");
}

//nuevo mensaje
if(isset($_POST['responder']))
{
    
    
//validar destinatario
    
$c_v_destinatario=mysql_query("select * from usuarios where usuario='".$_POST['destinatario']."'",$conexion)or die (mysql_error());
    if (
mysql_num_rows($c_v_destinatario)>0)
    {
        
          
mysql_query("insert into mensajes (
                                              asunto,
                                              mensaje,
                                              leido_autor,
                                              leido_destinatario,
                                              autor,
                                              destinatario,
                                              fecha,
                                              hora
                                              )values(
                                              
                                              '"
.$_POST['asunto']."',
                                              '"
.$_POST['mensaje']."',
                                              0,
                                              0,
                                              '"
.$_SESSION['usuario']."',
                                              '"
.$_POST['destinatario']."',
                                              now(),
                                              now()
                                              
                                              )"
,$conexion)or die (mysql_error());
                                              
$mensajes_exito="El mensaje ha sido enviado con &eacute;xito";
                                              
    }else{
        
$mensajes_error="El usuario no existe.";
    }
                                        
}

?>
<!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>
<link href="estilos.css" rel="stylesheet" type="text/css" />
</head>

<body onload="focux();">
<?php include("cabecera.php"); ?>
<?php 
include("barra.php"); ?>
<?php 
include("mensajes_error.php"); ?>
<div id="cuerpo">
  <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td align="center">&nbsp;</td>
    </tr>
    <tr>
      <td>

      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="50" align="center" valign="middle" bgcolor="#D7D7FF"><strong>&nbsp;&nbsp;NUEVO MENSAJE</strong></td>
          </tr>
        
        <tr>
          <td align="center">&nbsp;</td>
        </tr>
          
      </table>
      

      
      
      </td>
    </tr>
    <tr>
      <td align="center">&nbsp;</td>
    </tr>
    <tr>
      <td align="center">
      <form id="form1" name="form1" method="post" action="">
        <label for="destinatario"></label>
        <table border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>Para</td>
            <td><input name="destinatario" type="text" id="destinatario" size="60" value="<?php echo $_POST['destinatario']; ?>" /></td>
          </tr>
          <tr>
            <td>Asunto</td>
            <td><input name="asunto" type="text" id="asunto" size="60" value="<?php echo $_POST['asunto']; ?>" />
              </td>
          </tr>
          <tr>
            <td colspan="2" align="center"><textarea  name="mensaje" id="mensaje" cols="100" rows="15"><?php if(isset($_POST['mensaje'])){echo $_POST['mensaje'];} ?></textarea></td>
            </tr>
          <tr>
            <td colspan="2" align="center"><input type="submit" name="responder" id="responder" value="Enviar" /></td>
          </tr>
        </table>
        &nbsp;<br />
        <label for="asunto"></label>
        <br />
        <br />
      </form></td>
    </tr>
  </table>
  
  
  
  
</div>

<?php include("pie.php"); ?>
</body>
</html>
ZIP: http://pixeluno.com.ar/mansajeria_ce...a/mensajes.rar
http://www.cesarcancino.com/ejercici...-poo-n174.html

Porfavor ayudenme, alfin encontre un sistema de mensajeria con php&mysql y me aparece este error :( se q ustedes son secos, HELP ME!
__________________
Quieres aprender a crear sitios web dinamicos, no te pierdas, usa Dreamweaver CS5