Advertisement
Guest User

Untitled

a guest
May 27th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. //the js that saves all the inputs
  2. function _edit_campaign(){
  3. var data = formvalues_inspinia("body");
  4. data.action=_action;
  5. data.status=$("#smf_ior_status").val();
  6.  
  7. $.ajax({
  8. url: "/save_changes",
  9. dataType: "json",
  10. data: data,
  11. method:"POST",
  12. success: function (response) {
  13. if(!response.status){
  14. toastr_error(response.desc);
  15. $( "#submit_confirm" ).prop( "disabled", false );
  16. $("#"+response.camp).focus();
  17. }else{
  18. toastr_success(response.desc);
  19.  
  20. }
  21. }
  22. });
  23.  
  24. $.ajax({
  25. url: "ajax_php_file.php", // Url to which the request is send
  26. type: "POST", // Type of request to be send, called as method
  27. data: new FormData(this), // Data sent to server, a set of key/value pairs (i.e. form fields and values)
  28. contentType: false, // The content type used when sending data to the server.
  29. cache: false, // To unable request pages to be cached
  30. processData:false, // To send DOMDocument or non processed data file it is set to false
  31. success: function(data) // A function to be called if request succeeds
  32. {
  33.  
  34. });
  35.  
  36. $sourcePath = $_FILES['file']['tmp_name']; // Storing source path of the file in a variable
  37. $targetPath = "upload/".$_FILES['file']['name']; // Target path where file is to be stored
  38. move_uploaded_file($sourcePath,$targetPath) ; // Moving Uploaded file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement