S
S
Senbonzakuraa2018-02-14 03:32:36
AJAX
Senbonzakuraa, 2018-02-14 03:32:36

How to send data from php script connected via ajax?

There is a page to which I connect using Ajax php a page with forms and sending some data to the database. There are no connection problems, but there is a problem with sending data. If you send data directly from the script page, then everything works, but if you send data from the page to which Ajax output is sent, then when sending the page, it simply updates and does not send data to the database.
Here is the connection to the page:

$(function(e){
$('#edit').click(function(){
$.ajax({
  type: "POST",
  url: 'profiles/file.php',
  success: function(data) {
             $('#result').html(data);
  }
});
});
});

I think with the php part, and so everything is clear, everything is by default.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Drobyshev, 2018-02-14
@antoshadrobyshev

And what do you accept on the side of the php file? Why is there no data parameter in ajax request? What does the console say?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question