Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9083549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:48:01+00:00 2026-06-16T20:48:01+00:00

could someone please advise what is going wrong here? my username is: System In

  • 0

could someone please advise what is going wrong here?

my username is: System

In my inbox, I have 2 messages.
1 was sent to System and the other was sent to system.

I can delete the System mail, but when I try to delete the system message,
it gives me the ‘not your message’ error from my code.

here is the delete code from the view message page:

$delmsg=$_GET['delete'];

$idcheck = mysql_query("SELECT * FROM `inbox` WHERE `id`='$delmsg'");
$idfetch = mysql_fetch_object($idcheck);


    if ($delmsg !=''){
      if ($idfetch->to != $username){
         $errormsg = "Error - This is not your message to delete. Returning to your inbox... ";
         echo "<meta http-equiv=Refresh content=1;url=messages.php>";
      }else{
mysql_query("DELETE FROM `inbox` WHERE `to`='$username' AND `id`='$delmsg'");
         $errormsg = "Message deleted. Returning to your inbox...";
         echo "<meta http-equiv=Refresh content=1;url=messages.php>";
}
}

and here is the code from the send a message page:

if(strip_tags($_POST['send'])){

    $recipient= $_POST['sendto'];
    $subjectmsg= $_POST['subject'];
    $msgfull= $_POST['messagetext'];
    $date = date('Y-m-d H:i:s');

      if (!$recipient){
        $errormsg=" You must enter a recipient or your recipient's username must contain 3 or more characters. ";

    }elseif ($msgfull =="" || !msgfull){
        $errormsg="You cannot send a blank message. Please type your message in the text area above.";

    }elseif ($recipient && $msgfull){
        $checker=mysql_query("SELECT * FROM `user` WHERE `username`='$recipient'");
        $checkrows=mysql_num_rows($checker);

          if ($checkrows =="0"){
              $errormsg="User does not exist. Please check your SEND TO field";


    }elseif (!$subjectmsg){
    mysql_query("INSERT INTO `inbox` (`id`, `to`, `from`, `message`, `date`, `read`, `saved`, `subject`) VALUES 
                                     ('', '$recipient', '$username', '$msgfull', '$date', '0', '0', 'No Subject')");
                                     echo "<meta http-equiv=Refresh content=0;url=messages.php>";
    }else{
    mysql_query("INSERT INTO `inbox` (`id`, `to`, `from`, `message`, `date`, `read`, `saved`, `subject`) VALUES 
                                     ('', '$recipient', '$username', '$msgfull', '$date', '0', '0', '$subjectmsg')");
                                     echo "<meta http-equiv=Refresh content=0;url=messages.php>";
    }}
}

Both ‘username’ in the USER table and ‘to’ in the INBOX table are set to latin, varchar(255) if that helps.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:48:03+00:00Added an answer on June 16, 2026 at 8:48 pm

    Change the following line:

    if ($idfetch->to != $username){
    

    to:

    if (strtolower($idfetch->to) !== strtolower($username)){
    

    Using strtolower() to convert both the Name in the database and the Message name to lowercase before a comparison. Also changed (!=) to (!==) because we want an absolute match of type and value.

    It’s not a perfect solution, but its one option without changing alot of code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please could someone advise? We have an abstract base class with a few properties
Could someone please advise the current best practice around Date and Calendar types. When
Could someone please advise? If const in C++ defaults to internal linkage, why do
I am missing something in my SQL query, could please someone advise how to
Wondering if someone could please explain the difference between these two queries and advise
Could someone please advise in the context of a ASP.Net application is a shared/static
Could someone please advise if it is possible to develop for the Windows phone
Could someone please advise a free GUI editor (GUI designer)? This question was asked
Could someone please advise me how i could make this code more generic? I've
Could someone please advise me memory mgmt is needed or stringWithFormat is autoreleased. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.