Answer the question
In order to leave comments, you need to log in
How to implement ajax registration in dle?
Help implement ajax registration in dle. Here is the code from the Dle API. It is responsible for registering users.
$dle_api->external_register( string $login, string $password, string $email, int $group);
<form enctype="multipart/form-data" method="post" id="ajaxreg" class="rel">
<input type="text" name="ajaxname" id="ajaxname" placeholder="Логин">
<input type="text" name="ajaxpass" id="ajaxpass" placeholder="Пароль">
<input type="text" name="ajaxmail" id="ajaxmail" placeholder="Почта">
<input type="submit" id="submit" value="Зарегистрироваться">
</form>
$(function(){
'use strict';
$('#submit').on('submit', function(e){
$.ajax({
type: "POST",
url: "/engine/ajax/ajaxreg.php", // Имя файла к которому будет идти AJAX запрос
data: // Не знаю, что в дату писать...
success: function(data){
alert(data.success); // Итог
}
});
}
});
<?php
include ('engine/api/api.class.php');
$email = $_POST['ajaxmail'];
$login = $_POST['ajaxname'];
$password = $_POST['ajaxpass'];
$dle_api->external_register( string $login, string $password, string $email, int $group);
Answer the question
In order to leave comments, you need to log in
Usually such modules are written to order, but you can write to me in VK with the note "ajax registration in dle (from the toaster)" and there we will figure it out :3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question