Answer the question
In order to leave comments, you need to log in
How to use handler data after ajax request?
I'm trying to deal with Ajax, I ask you not to swear much))
I want to understand how to operate with data from the handler and what is it all about?
There is such a problem: there is a registration form on the "Test" page, I press the registration button and send the data with Ajax to the test.php handler, where a random n-number is generated and sent to the phone indicated in the registration form.
$.ajax({
url: "test.php",
success: function(data){
Появляется модальное окно;
}
});
<?
$chislo = рандомное число;
отправили на телефон
?>
Answer the question
In order to leave comments, you need to log in
The question is difficult to explain without knowledge of the theory.
I recommend implementing this script without JS, and only then, when .php is ready, implement ajax
1. To understand what the .php file returns, you need to see its code. It would be nice if you attached it here. Commonly used functions for debugging: var_dump, print_r (type them into google and you will see a link to php.net)
2. Of course you can save it, and in various ways, here are some of them: sessions, saving to a text file, saving to a database
Choose to taste :)
Links
php.net/manual/ru/features.cookies.php
php.net/manual/ru/session.examples.basic.php
php.net/manual /en/function.file-put-contents.php
php.net/manual/en/book.mysql.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question