Answer the question
In order to leave comments, you need to log in
PHP is treated as text in an AJAX request. What to do?
When the button is clicked, an ajax request is made to the handler file. This file should take data from the database and form html. Everything works locally. On hosting, the entire contents of the php-file handler is perceived as text. It does not matter what is written in php, it is still issued as text. For example, in php it says <?php echo "test"; ?> As a result, I will not get the word "test" but rather <--?php echo "test"; ?--> What to do? What is the problem?
Answer the question
In order to leave comments, you need to log in
Problem solved. The hoster configured the server in such a way that when accessing php files, these files are downloaded directly. stupid hosting...
if you go through the browser to the address to which ajax accesses, then also <--?php echo "test"; ?--> ? what web server? what is the extension of the php file?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question