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

  • Home
  • SEARCH
  • 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 4602632
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:01:05+00:00 2026-05-22T00:01:05+00:00

actually i want to send a comment to the each image and it should

  • 0

actually i want to send a comment to the each image and it should display just after clicking the button . I am able to do insert and retrieve the comment but it require refresh the page and i don’t want to refresh….just like orkut.plz help me i m new in php…

thans to all…………

insertimg.php

//________________________________________FOR INSERT COMMENT_____________________________________________________
if (isset($_POST['Submit'])) 
{
$sql = "INSERT INTO comment(imid, comm) values ('".mysql_real_escape_string(stripslashes($_REQUEST['imgId']))."', '".mysql_real_escape_string(stripslashes($_REQUEST['Comment']))."')";
//$sql = "INSERT INTO comment (com) VALUES ($_POST['Comment'])";
//$sql="UPDATE upload SET comm='$_REQUEST['Comment']'WHERE id='$_REQUEST['imgId']'";
if($result = mysql_query($sql ,$conn)) 
  {

     echo "submited:";

   }
else 
   {
    echo "<h1>problem </h1> ".mysql_error();
   }

} 

For display comment..

$page=$_GET["page"];
$sql = "select comm from comment where imid = '".$page."'";

$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not get data: ' . mysql_error());
}
echo"Comments:";
echo "<br>";
echo "<br>";
while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
{

 //echo $row['comm'];
 echo "<textarea name=\"Comment\" style=\"background-color:#81F7BE;\">"; echo $row['comm']; echo "</textarea>";
 //echo "<font>";
 echo "<br>";
 echo "<br>";
}   
mysql_close($conn);

?>
  • 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-22T00:01:06+00:00Added an answer on May 22, 2026 at 12:01 am

    You can solve it with AJAX.
    You can use something like jQuery Ajax library.

    $.ajax({
       type: "POST",
       url: "inserting.php",
       data: "imid=1&comm=Hi",
       success: function(msg){
         alert( "Ajax Response: " + msg );
       }
     });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to send mail after specific time Actually I want to send mail
I want send some data to a remote webpage from my site. Actually it
i want to send a message to a tableView in another controller. Actually i
If I want to send email through Django and DotCloud, how should I do
How do I enumerate the properties of a JavaScript object? I actually want to
I got a question ;) Actually I want to use core-data in different threads.
Somehow my master and my origin/master branch have diverged. I actually don't want them
I want to know what actually happens when you annotate a method with @Transactional
Actually it's a lot easier to show you what I want to achieve instead
Actually, I want to integrate spring javadoc with my netbeans IDE. Spring website only

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.