Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/02/2013, 11:12
oweer
 
Fecha de Ingreso: enero-2013
Mensajes: 38
Antigüedad: 11 años, 3 meses
Puntos: 0
Exclamación syntax error, unexpected T_VARIABLE

Hola me podrian ayudar.. me dice que tengo error en la siguiente linea:

$sqlmensaje = "INSERT INTO mensaje (para,de,fecha,asunto,texto) VALUES ('"$fecha"','".$_SESSION['usuario']."','"$fecha"','"$fecha"','".$_POST['mensaje']."')";



Este es mi codigo :

<?php
# Incluimos la configuracion
include('acceso_db.php');
session_start();
if($_SESSION['logueado'] != "SI"){
header('location: index.php');
exit();
}
# Obtenemos el mensaje privado
$id = $_GET['id'];
$sql = "SELECT * FROM mensaje WHERE para='".$_SESSION['usuario']."' and ID='".$id."'";
$res = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($res);
?>

Menu: <a href="listar.php">Ver mensajes</a> | <a href="crear.php">Crear mensajes</a> | <a href="cerrar.php">Cerrar sesion</a><br /><br />


<strong>De:</strong> <?=$row['de']?><br />
<strong>Fecha:</strong> <?=$row['fecha']?><br />
<strong>Asunto:</strong> <?=$row['asunto']?><br /><br />
<strong>Mensaje:</strong><br />
<?=$row['texto']?>

<?php
# Avisamos que ya lo leimos
if($row['leido'] != "si")
{
mysql_query("UPDATE mensaje SET leido='si' WHERE ID='".$id."'") or die(mysql_error());
}
?>

<?php
if($_POST['enviar'])
{
if(!empty($_POST['texto']))
{
$fecha = date("j/m/Y, g:i a");
$destino= $row["de"];
$sqlmensaje = "INSERT INTO mensaje (para,de,fecha,asunto,texto) VALUES ('"$fecha"','".$_SESSION['usuario']."','"$fecha"','"$fecha"','".$_POST['mensaje']."')";
mysql_query($sqlmensaje);
echo "Mensaje enviado correctamente.";
}
}
?>



<form method="post" action="" >

Responder :<br />
<textarea name="mensaje"></textarea>
<br /><br />
<input type="submit" name="enviar" value="Enviar" />
</form>



ME PODRIN AYUDAR