This is the first real stumbling block i've come across in PHP and i've been using it for years - that's how confused I am with this problem - maybe i'm just tired and can't see it!!!
I am currently developing a personal messaging part of my site, and when reading a message, have a delete button. If the message is NOT in deleted items, it puts it in there. If it is in deleted items, it deletes the message altogether. All fine there.
I have the following code at the top of my page when the delete button is pressed:
Code: Select all
if (isset($_POST['delete']))
{
$TempMessage = New Message($id);
$qry = "";
if ($TempMessage->mFolder->mfID == 3)
{
$qry = "DELETE FROM user_message WHERE usme_id = '".$id."'";
}
else
{
$qry = "UPDATE user_message SET mefo_id = 3 WHERE usme_id = '".$id."'";
}
$qry_res = @mysql_query($qry, $db);
if ($qry_res != false)
{
Header("Location: messages.php");
}
}
Code: Select all
$ThisMessage = New Message($id);
if ($ThisMessage->mUserID != $_CurrentUser->uID)
{
Header("Location: ../400.shtml");
}
Sorry if you don't understand my issue - I will try and delve further if necessary. It's really stumped me!!
Thanks in advance.