<form action = 'javascript:void(null)' onsubmit="call()">
...
<input name = 'name' type = 'text' required>
...
<input type = 'submit'>
</form>
<script>
function call() {
$.post(
"<?php echo get_template_directory_uri(); ?>/send.php",
{
name: name,
phone: phone,
mail: mail,
price: price,
item: item,
type: type,
catalog: catalog,
},
function(data) {
if (data==1) {
$('.popupout').fadeOut();
$('#message').fadeIn();
}
});
};
}
</script>
class User extends Model {
private $name;
private $id;
public getName() { return $this->name}
public getID() {return $this->id}
public setName($name) {
$me = User::firstOrCreate(['id' => $this->id])
$this->name = $me->name = $name;
$me->save();
}
}