Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- var name;
- var email;
- var comment;
- var url;
- var captcha;
- var data;
- var post_id;
- $(document).ready(function(){
- $("#commentall").load("wy_controlls/wy_comment.php","action=getComment&post_id="+<?php echo $_GET['post_id'];?>);
- $("#commentForm").submit(function(){
- name = $("#cname").val();
- email = $("#cemail").val();
- comment = $("#ccomment").val();
- captcha = $("#txtCaptcha").val();
- post_id = $("#post_id").val()
- url = $("#curl").val();
- if( name =="" || email == "" || comment == "" ||captcha == "" ){
- $("#report").html("<img src='wy_files/images/error.png' />Could not sending comment..");
- }else{
- data = "&post_id="+post_id+"&name="+name+"&email="+email+"&url="+url+"&comment="+comment+"&captcha="+captcha;
- $("#report").html("<img src='wy_files/images/loading.gif' /> Sending comment... ");
- $.ajax({
- type : "post",
- url: "wy_controlls/wy_submitcomment.php",
- data: "action=add"+data,
- cache: false,
- success: function(msg){
- if(msg=="sukses"){
- $("#report").html("<img src='wy_files/images/tick.png' /> Comment sent...");
- $("#cname").val("");
- $("#cemail").val("");
- $("#ccomment").val("");
- $("#curl").val("");
- $("#txtCaptcha").val("");
- img = document.getElementById('captcha');
- img.src = 'wy_controlls/wy_image.php';
- $("#commentall").load("wy_controlls/wy_comment.php","action=getComment&post_id="+post_id);
- }else{
- $("#report").html("<img src='wy_files/images/error.png' /> Error Message : "+msg);
- img = document.getElementById('captcha');
- img.src = 'wy_controlls/wy_image.php';
- }
- }
- });
- }
- return false;
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment