Advertisement
yesamarcos

Passando valores por $_POST e pegando dentro do post.php !!!

Jan 3rd, 2017
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <script>
  2. jQuery(document).ready(function(){
  3.     jQuery('#setting-add-fanfic').submit(function(){
  4.        
  5.         var fanfic_id = $("input[name='fanfic_id']").val();
  6.         var user_id = $("input[name='user_id']").val();
  7.  
  8.         jQuery.ajax({
  9.             type: "POST",
  10.             url: "<?php echo base_url("functions_extra/post.php"); ?>",
  11.             data: {fanfic_id: fanfic_id, user_id: user_id},
  12.             success: function( data ){
  13.                 $('#alert').html('<?php echo $wo['lang']['success'];?>');
  14.             }
  15.         });
  16.         return false;
  17.     });
  18. });
  19. </script>
  20.  
  21. // Arquivo post.php
  22.  
  23. $fanfic_id = $_POST["fanfic_id"];
  24. $user_id = $_POST["user_id"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement