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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:44:14+00:00 2026-05-13T20:44:14+00:00

On a users profile, there is a comment box that enables other users to

  • 0

On a users profile, there is a comment box that enables other users to post comments on their profile. I am now working on a dynamic comment area that has a changing text box depending on if A. you are looking at your own profile B. looking at someone elses profile C. not signed in at all.

I am trying to implement “updates” now when you are on your own page, type in the comment box, and it outputs in a designated area on your page. ( going to have it output on a community page but not there yet)

On this profile page, I have the insert query that is inserting regular comments just fine (the first insert query) and now am trying to add a second if(isset statement with a second insert query and am having trouble doing this.

It is not inserting and the page is loading blank after the submit button is hit. I am a newbie with php btw. Thank you:

    /* code chunk for the regular comments that is working just fine */

       if(isset($_POST['commentProfileSubmit']) && $auth) {

       $query = "SELECT `Email` FROM `Users` WHERE `id` = '" . $prof->id . "'";
       $request = mysql_query($query,$connection) or die(mysql_error());
       $result = mysql_fetch_array($request); 

       $Email = $result['Email'];


       $to = $Email;
       $subject = "$auth->first_name $auth->last_name left you a comment";
       $message = "$auth->first_name $auth->last_name left you a comment: <br /><br /> <a href='http://www.blah.org/Profile.php?id=" . $prof->id . "'>Click here to view</a><br /><br />";
       $from = "blah <noreply@blah.org>";
       $headers  = 'MIME-Version: 1.0' . "\r\n";
       $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
       $headers .= "From: $from";
       mail($to, $subject, $message, $headers);



        $query = "INSERT INTO `ProfileComments` 
                                ( `FromUserID`,
                                  `ToUserID`,
                                  `commentProfileBody`,
                                  `status`,
                                  `date`,
                                  `time`

                                    ) VALUES (

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

    mysql_query($query,$connection); 

     /* code chunk that is not inserting the desired info into the db and loading the page blank when I hit submit */

      }elseif(isset($_POST['airwaveSubmit']) && $auth) {

      $query2 = "INSERT INTO `Airwaves`
                            ( `id`,
                             `body`,
                             `status`,
                             `date`,
                             `time`

                            ) VALUES (

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

                                            mysql_query($query,$connection);    

            }
         ?> 

    /* dynamic text/areas with dynamic submit buttons which is working how it should but want to include in case there is something on here that is causing the previous troubles */

<div id="commentBoxBlog">
<form name="CommentBox" method="post" action="Profile2.php?id=<?php echo $prof->id; ?>">
    <?php if($auth->id == $prof->id) {
    echo    "<div id='counter'>
    <span id='counter_airway'>140 Character Limit</span>
    </div>";
    echo "<textarea name='airwaveBody' class='round_10px' onkeyup='limit_length(this,140,\"counter_airway\");'></textarea>  <input type='submit' name='airwaveSubmit' value='Exhale' class='post'/>";} elseif(!$auth) {
 echo "<textarea name='ProfileComment' class='round_10px' disabled>Please sign in to comment...</textarea>";  } elseif($auth->id != $prof->id) 
  echo "<textarea name='ProfileComment' class='round_10px'></textarea>
    <input type='submit' name='commentProfileSubmit' value='Exhale' class='post' />";

    ?>
    </form>
</div>
  • 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-05-13T20:44:15+00:00Added an answer on May 13, 2026 at 8:44 pm

    You put the SQL in a variable named $query2, but in your mysql_query() call to send it to the database you use a variable named $query.

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

Sidebar

Related Questions

Most of my users have email addresses associated with their profile in /etc/passwd .
I am looking for a way to search through every users profile using the
I'm trying to use a generic list as a property of the users profile.
I am wondering why the link to profile looks like: http://stackoverflow.com/users/ID/NAME not simply: http://stackoverflow.com/users/ID
I'm in the process of working on a user profile system for a website
I have a database that hold's a user's optional profile. In the profile I
At the wordpress form, when you leave comment as guest, there's a website field
I need to build an activity feed to go on each users profile page
What I'm trying to do is pull up profile info w/ the profile's comments.
I'm building a website that contains users with user profiles. Many of the fields

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.