Need help w/ a bug in my private messaging script
Posted: Tue Nov 08, 2005 4:37 pm
Hey, I came across a problem with my private messaging. First, users can can send message on a users profile, then enter in a subject and comment.
From there it notifies the user they have a message, and They can click on the subject to open it. My only problem is that when no subject is entered, it shows the sender name and date but there is nothing to click on.... how can I make it say (no subject) when nothing is entered? here is my code:
so basically the variable I need an if/else for $mssg_subject im just not sure how to do it
From there it notifies the user they have a message, and They can click on the subject to open it. My only problem is that when no subject is entered, it shows the sender name and date but there is nothing to click on.... how can I make it say (no subject) when nothing is entered? here is my code:
Code: Select all
if($action=="del")
{
$sqlDel = "delete from `$usrmssg_tbl` where `mssg_id` ='$mssg_id'";
mysql_query($sqlDel) or die("Error..".mysql_error());
}
if($action=="read")
{
$sql = "update `$usrmssg_tbl` set `read_status` = '0' where `mssg_id` ='$mssg_id'";
$res = mysql_query($sql) or die("Error..".mysql_error());
}
if($_POST[sendMssg])
{
$sqlIns = "insert into `$usrmssg_tbl` values('',
'$to_id',
'$from_id',
'$mssg_subject',
'$mssg_body',
'1',
NOW())";
mysql_query($sqlIns) or die("Error...".mysql_error());
echo "<script>
alert('Message has been sent successfully');
</script>";
$action="";