Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //the js that saves all the inputs
- function _edit_campaign(){
- var data = formvalues_inspinia("body");
- data.action=_action;
- data.status=$("#smf_ior_status").val();
- $.ajax({
- url: "/save_changes",
- dataType: "json",
- data: data,
- method:"POST",
- success: function (response) {
- if(!response.status){
- toastr_error(response.desc);
- $( "#submit_confirm" ).prop( "disabled", false );
- $("#"+response.camp).focus();
- }else{
- toastr_success(response.desc);
- }
- }
- });
- $.ajax({
- url: "ajax_php_file.php", // Url to which the request is send
- type: "POST", // Type of request to be send, called as method
- data: new FormData(this), // Data sent to server, a set of key/value pairs (i.e. form fields and values)
- contentType: false, // The content type used when sending data to the server.
- cache: false, // To unable request pages to be cached
- processData:false, // To send DOMDocument or non processed data file it is set to false
- success: function(data) // A function to be called if request succeeds
- {
- });
- $sourcePath = $_FILES['file']['tmp_name']; // Storing source path of the file in a variable
- $targetPath = "upload/".$_FILES['file']['name']; // Target path where file is to be stored
- move_uploaded_file($sourcePath,$targetPath) ; // Moving Uploaded file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement