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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:00:11+00:00 2026-05-27T20:00:11+00:00

this is my jquery coding $(‘#btnKirimPesan’).click(function(){ $(‘#bantu’).load(‘kirim_pesan.php’, {’emailPenerima’: $(‘#emailPenerima’).val(), ‘isiPesan’: $(‘.isiPesan’).val()}); }); then this

  • 0

this is my jquery coding

$('#btnKirimPesan').click(function(){
        $('#bantu').load('kirim_pesan.php', {'emailPenerima': $('#emailPenerima').val(), 'isiPesan': $('.isiPesan').val()});
    });

then this is on kirim_pesan.php

<?
include('../../config/buka_koneksi_db.php');
$query = "INSERT INTO pesan(emailPenerima, emailPengirim, statusBaca, isiPesan, waktuPesan) VALUES((SELECT emailUser FROM user WHERE MD5(emailUser) = '".$_POST['emailPenerima']."'), '".$_SESSION['email']."', 0, '".$_POST['isiPesan']."', NOW('d/m/Y/H/i/s'))";
$hasilQuery = mysql_query($query);
if(mysql_affected_rows()>=1)
    $hasil = 1;
    else
            $hasil = 0;
include('../../config/tutup_koneksi_db.php');
?>

The jquery coding and query inserting new row is in different file. I want to reload a div in jquery file(it’s php file) if only $hasil = 1;, if its == 0, I’ll show dialog which say “your message has not been sent”…how can i do it??please help me…>,<…thx before

  • 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-27T20:00:12+00:00Added an answer on May 27, 2026 at 8:00 pm

    The load() jQuery method places the HTML returned by the server inside the element. So, assuming that #bantu is the ID of the div where you want to show the message, changing your kirim_pesan.php file to the following should do it:

    <?
    include('../../config/buka_koneksi_db.php');
    $query = "INSERT INTO pesan(emailPenerima, emailPengirim, statusBaca, isiPesan, waktuPesan) VALUES((SELECT emailUser FROM user WHERE MD5(emailUser) = '".$_POST['emailPenerima']."'), '".$_SESSION['email']."', 0, '".$_POST['isiPesan']."', NOW('d/m/Y/H/i/s'))";
    $hasilQuery = mysql_query($query);
    if(mysql_affected_rows()>=1)
        echo "Message sent!";
    else
        echo "Your message has not been sent.";
    ?>
    

    Documentation: http://api.jquery.com/load/

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

Sidebar

Related Questions

Using this jquery code: <a href=javascript:void(0) id=m1>Get Selected id's</a> jQuery(#m1).click( function() { var s;
I have this jQuery which works fine $(li[id^='shop_id']).click( function () { alert(I clicked on
I'm using this: jQuery('.class1 a').click( function() { if ($(.class2).is(:hidden)) { $(.class2).slideDown(slow); } else {
I'm working on some form UI coding and wrote this jQuery one-liner: $('input[type=text]').val($(this).attr('default-value')); Intention
Trying to replace this jquery code with some php server side magic: $(document).ready(function() {
I have this jQuery: $(document).ready(function() { $(#panel).hide(); $('.login').toggle( function() { $('#panel').animate({ height: 150, padding:20px
I'm coding a function in jquery that executes if Ctrl + R is pressed
I need to add a url redirect to this coding this is the jquery
I'm coding a form using PHP and jQuery. I have a file upload field
I want to call ajax function with the jQuery. Here is my sample coding

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.