[ajax] Why a POST request never reaches the php file?

Trying to implement the test purchase case study on the website.
Make an ajax request with the ID of the case, a php script checks purchased it.
If purchased - returns a response that the page begins to scroll roulette
If the briefcase is purchased - response is returned, based on which the window appears(sweetalert2) with the text "you must buy a case" and two buttons: "Buy" and "Cancel".
Click on to buy, another query. PHP file while not checking the balance and not buying the case, just gives the answer that the case is purchased(for the test). Or rather, must give this response, but actually does not..
Either I did something with ajax, may request isn't sent, and maybe in the php file missed something.

Code references:

JS code: pastebin.com/Kk07EwDp
PHP code: pastebin.com/f9pm6LWW
August 19th 19 at 23:40
2 answers
August 19th 19 at 23:42
The developer console in the browser shows the request? The settings in it are correct? The web server log shows the request? The error log of the web server shows no errors in the script?
I'm writing on Locke.the server is Denver. As it is possible to see the logs? - Hunter commented on August 19th 19 at 23:45
: the browser console - maximillian_Fadel commented on August 19th 19 at 23:48
: Under Windows I do not know, try to look for the logs folder in the site directory or one level above. - Erling.Berni commented on August 19th 19 at 23:51
: do not have the logs. for starters, look if you have sent a request to a server (pressing F12 in the browser, at least in chrome) and there the network tab. It shows everything that happens, if all goes correctly, it should look exactly the logs of the backend. In Denver they can be anywhere, not only from the server depends, if you use some framework logs may be maintained in any great location.
Buck the logs will show what is happening on the buck, maybe there are any errors.

There is another option a little treshovy of course, but nonetheless at least give you an idea of what is happening on the buck in each of the if prescribe print_r or var_dump with some string and see what is output and displayed, if at all. For example:

if () {
print_r ('case 1');
}
elseif () {
print_r('scenario 2');
}

Well, figuratively of course. This will give you the understanding you get if you in General in IPY and whether there's something... that you can dance somehow - antoinette18 commented on August 19th 19 at 23:54
: I don't understand what the error is. Tried your method, the information is not displayed, the request somehow is not sent. Decided to simplify the code below was a test purchased by the case or not.
If you bought open if there is no - side php handler change the balance after the purchase, change the winning value and stuff like that and output the result, they say, all good. If there is not enough money out, no money. It worked, and less code - Hunter commented on August 19th 19 at 23:57
August 19th 19 at 23:44
$.post("http://test1.ru/inc/api.php",'┬žion=cases&cid='+cid,function(data) {});

And isn't it?
$.post('http://test1.ru/inc/api.php?section=cases&cid='+cid,function(data) {});
I honestly don't know.
Previously used $.ajax and formed the body of the request there.
Then, I was advised to use $.post and brought the example with the comma.
It seems to be working. - Hunter commented on August 19th 19 at 23:47

Find more questions by tags AJAXPHP