[Solved]: cannot post comments [Solved]: cannot post comments
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Solved]: cannot post comments

Started by okiem, February 17, 2008, 09:38:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

okiem

I have problem with posting comments. It looks diferently in IE and in Firefox-

IE.
After posting (cliking OK) I see error page with notification that is some problem with viewing db_input.php, after refreshing there is note taht is missing some parameter.

Firefox
After posting is opened small window od downloading page (db_input.php)

I use Captcha plugin, but without it, everything is the same, sitaution is the same if you are logged or not, also with e-mail notofication to admin or not.

My database   www.genealogia.okiem.pl/foto2

Tranz

I was able to post a comment here: http://genealogia.okiem.pl/foto2/displayimage.php?pos=-116

Did it in FF.

Could this have been a temporary problem with your server? Can you try again now? It seems other people have been able to post comments: http://genealogia.okiem.pl/foto2/thumbnails.php?album=lastcom&cat=0

okiem

Yes - I am able also post comments - (first comments) but I cannot post second comment if one already exist. Try

http://www.genealogia.okiem.pl/foto2/displayimage.php?pos=-645

Tranz

Ok, I tried it and it did prompt to download the db_input.php file. I downloaded and opened it in a text editor and it was blank. I don't know what could be causing this if you say that it's an issue with the captcha mod and without it.

okiem

It happen only with CAPTACH - but:

during installing Captach it dosn't work properly so I discover that i have put some code id d_input.php
section comment looks now:

Quote// Comment

    case 'comment':
        if (!(USER_CAN_POST_COMMENTS)) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);


        check_comment($_POST['msg_body']);
                check_comment($_POST['msg_author']);
        $msg_author = addslashes(trim($_POST['msg_author']));
        $msg_body = addslashes(trim($_POST['msg_body']));
        $pid = (int)$_POST['pid'];

        if ($msg_author == '' || $msg_body == '') cpg_die(ERROR, $lang_db_input_php['empty_name_or_com'], __FILE__, __LINE__);

        $result = cpg_db_query("SELECT comments FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND pid='$pid'");
        if (!mysql_num_rows($result)) cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
        $album_data = mysql_fetch_array($result);
        mysql_free_result($result);

        if ($album_data['comments'] != 'YES') cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);

        if (!$CONFIG['disable_comment_flood_protect']){
          $result = cpg_db_query("SELECT author_md5_id, author_id FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid = '$pid' ORDER BY msg_id DESC LIMIT 1");
          if (mysql_num_rows($result)) {
              $last_com_data = mysql_fetch_array($result);
              if ((USER_ID && $last_com_data['author_id'] == USER_ID) || (!USER_ID && $last_com_data['author_md5_id'] == $USER['ID'])) {
                  cpg_die(ERROR, $lang_db_input_php['no_flood'], __FILE__, __LINE__);
              }
:)            require("include/captcha.class.php");
:)        if (!PhpCaptcha::Validate($_POST['confirmCode'])) {
:)          cpg_die(ERROR, "Confirmation code didn't matched", __FILE__, __LINE__);
:)        }
      }
        }

Runing without CAPTACHA I have to uninstall plugin and erase those "happy" lines. After it I CAN post second message.

Joachim Müller

Try the captcha plugin instead of the captcha mod. Use the most recent version of the mod if you must stick with it.

okiem

ha! I discover mistake - very simple

Quote
                  cpg_die(ERROR, $lang_db_input_php['no_flood'], __FILE__, __LINE__);
:)             
            require("include/captcha.class.php");
        if (!PhpCaptcha::Validate($_POST['confirmCode'])) {
          cpg_die(ERROR, "Confirmation code didn't matched", __FILE__, __LINE__);
:)             }
              }
           }
        }