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 7916885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:58:16+00:00 2026-06-03T14:58:16+00:00

this is pretty much an updated version of question I’ve already asked. I am

  • 0

this is pretty much an updated version of question I’ve already asked. I am pretty sure its the j-query I have is NOT interfering. For some reason my if statement in this case is not triggering as should. Long story short: I am able to limit the replies but can not get the error message to display.

Some of the if’s are working, I will be sure to point out the one that is not.

Thanks in advance.

this IS working:

if(isset($_POST['sub_comment_reply'])) {
    if($_POST['reply'] == "" ) {
    $valid = false;
    $error_msgs_reply[] = "Whoops! You forgot to write your reply.";
    }else{

        $query = "SELECT COUNT(*) FROM `CysticAnswers_replies`
                  WHERE `FromUserID` = $auth->id
                    AND `date` = CURDATE()";
        $result = mysql_query($query, $connection);
        $post_count = mysql_result($result, 0);
        $max_reply_per_day = 5;




        //Debugging lines
        echo "Query: {$query}<br>\n";
        echo "Post count for user id {$auth->id} is {$post_count}<br>\n";

        if($post_count >= $max_reply_per_day){
                $valid = false;
                $error_msgs_replies_max[] = "Whoops! You have reached your limit of answers for the day.";
        }
        else
        {
        $query = "INSERT INTO `CysticAnswers_replies`
                                            ( `QuestionCommentID`,
                                              `FromUserID`,
                                              `comment`,
                                              `status`,
                                              `date`,
                                              `time`
                                            ) VALUES (

                                            '" . mysql_real_escape_string($_POST['comment']) ."',
                                            '" . $auth->id ."',
                                            '" . mysql_real_escape_string($_POST['reply'])."',
                                            'active',
                                            '" . date("Y-m-d") . "',
                                            '" . date("G:i:s") . "')";

            mysql_query($query, $connection);



}

This is the portion of trying to trigger the error message and is NOT being triggered:

<?php if(isset($_POST['sub_comment_reply']) && $post_count >= $max_reply_per_day ) {

    foreach($error_msgs_replies_max as $msg) { ?>
    <div id="error_x">
    <?php echo $msg; ?>
    </div>
    <?php }
?>

<?php } ?>
                <a name='reply_form_<?php echo $result['id']; ?>' style="clear:both"></a>
                <div id='reply_to_<?php echo $result['id']; ?>' class="respond_structure_future" <?php if(isset($_GET['reply_to']) && $_GET['reply_to'] == $result['id']) { echo 'style="display:block;"';}else{ echo 'style="display:none;"';} ?>>
                    <div class="respond_polaroid_future">
                        <a href="http://www.cysticlife.org/Profile.php?id=<?php echo $auth->id; ?>">
                            <img src="<?php echo $auth->img('mini'); ?>" />
                        </a>
                    </div>                              
                    <form name='comment_reply' action='<?php echo $_SERVER['REQUEST_URI']; ?>' method='post'>
                        <div class="respond_body_future round_10px">
                            <div class="respond_arrow_future"></div>
                            <div class="respond_tail_future"></div>
                            <div class="respond_data_future">
                                <textarea id="reply_to_<?php echo $result['id']; ?>_textarea" name='reply'></textarea><br />
                                <input type='hidden' name='comment' value='<?php echo $result['id']; ?>' />
                                <div class="respond_nevermind">
                                    <a href="reply_to_<?php echo $result['id']; ?>">nevermind</a>
                                </div>
                                <input type='submit' class="submit" name='sub_comment_reply' value='Reply' />
                            </div>
                        </div>
                    </form>
                </div>

        <?php } ?>
  • 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-03T14:58:17+00:00Added an answer on June 3, 2026 at 2:58 pm

    Have you tried:

    if (isset($error_msgs_replies_max)) foreach($error_msgs_replies_max as $msg) {
      // Do stuff
    } else print 'No variable $error_msgs_replies_max';
    

    ?

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

Sidebar

Related Questions

This is pretty much the same problem i have, except with very different code:
This is pretty much a duplicate question but instead of using Castle Dynamic Proxy
This question does pretty much what I want to accomplish, but my table is
Pretty much the same as this question. But I can't seem to get this
This is pretty much just a simple join statemnet I believe. I've not worked
this pretty much is the thing. When in tinymce I press anything that is
I think this is pretty much the simplest case for mapping a Map (that
I found this tutorial which pretty much does exactly what I want: http://webstutorial.com/jquery-popup-jquery-slide-popup/jquery Except
I am pretty much new in this. I know Remoting, HTTPService and WebService. I
Yea pretty much it. On windows xp sp3. This is what happens: jruby -S

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.