I have created user registration form and pass that values to class successfully. I want to know how to save that data using jquery ajax. but I don't know the way to call php class via jquery ajax. my code is this:
<?php
if(isset($_POST['register'])){
$register = new Users();
$msg = $register->registration($_POST['fullname'], $_POST['email'], $_POST['phone'], $_POST['password'], $_FILES);
}
?>
<h3> Registration </h3>
<?php
if(isset($msg)){
echo $msg;
}
?>
<form action="" method="post" enctype="multipart/form-data">
<p> Full name: <input type="text" name="fullname"/> </p>
<p> Email: <input type="email" name="email"/> </p>
<p> Phone: <input type="phone" name="phone"/> </p>
<p> Password: <input type="password" name="password"/> </p>
<p> Photo 1: <input type="file" name="photo[]"/> </p>
<p> Photo 2: <input type="file" name="photo[]"/> </p>
<p> <input type="submit" name="register" value="Register"/> </p>
</form>
Please someone help me to save this form using jquery ajax.