Answer the question
In order to leave comments, you need to log in
Why is the data from the form not being added to the database?
The data is received into the handler, but then it is not added to the database, everything seems to be in order with the connection, since it is possible to pull data from the database with it.
$(function() {
$('.sign-up-form').submit(function(e) {
var $form = $(this);
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize()
}).done(function() {
alert('success');
}).fail(function() {
alert('fail');
});
e.preventDefault();
});
});
$login = $_POST['login'];
$name = $_POST['name'];
$lastname = $_POST['email'];
$email = $_POST['email'];
$password = $_POST['password'];
mysql_query("INSERT INTO client(client_login, client_name, client_lastname, client_email, client_password) VALUES (
'".$login."',
'".$name."',
'".$lastname."',
'".$email."',
'".$password."',
)", $link);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question