delete message function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I created the below delete function, but it doesn't seem to be working
correctly. When I enter the correct password it get my echo "Incorrect
Password Did not Delete!" When I leave the password blank the message
will delete from mysql table.

Am I missing something??

Thanks in advance,

Chris

    function delete_message(&$msg) {
        extract($msg, EXTR_PREFIX_ALL, 'row');
        $result = mysql_query("SELECT ID FROM mbmsgs WHERE Parent = $row_ID;");

        while ($row = mysql_fetch_array($result)) {
            delete_message($row);
        }
        mysql_query("DELETE FROM mbmsgs WHERE ID = $row_ID;");
    }

    $result = mysql_query("SELECT Title, Password FROM mbmsgs WHERE ID
= {$_REQUEST['Msg']};");
    if (!$result) exit;
    if (!mysql_num_rows($result)) exit;
    extract(mysql_fetch_array($result), EXTR_PREFIX_ALL, 'msg');

    if (isset($_POST['Password'])) {
        if (sha1($_POST['Password']) != $msg_Password) {
            echo "Incorrect password did not delete!";
            exit;

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux