# AJAX response error

**URL:** <https://forum.infinityfree.com/t/ajax-response-error/29546>\
**Category:** Hosting Support\
**Created:** [May 4, 2020, 10:18pm UTC](https://forum.infinityfree.com/t/ajax-response-error/29546 "2020-05-04T22:18:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aryqs-Ipsum](https://forum.infinityfree.com/letter_avatar/aryqs-ipsum/32/5_5575768a8748004e209b776fc1b2916d.png) [@Aryqs-Ipsum](https://forum.infinityfree.com/u/Aryqs-Ipsum)\
**Post date:** [May 4, 2020, 10:18pm UTC](https://forum.infinityfree.com/t/ajax-response-error/29546/1 "2020-05-04T22:18:00Z")

</div>

Hello, I’ve created a AJAX script to send mails, I’ve tested my code in **localhost and everything worked fine**. But, in my website, the request has an error.

`jquery.min.js:2 POST https://omsistuff.ga/php/lib/bugreport.php net::ERR_FAILED`

I’ve set a code to show ajax request error but it’s work only in local. I see that the php file that analyse my request is marked in red in the network console, but I d’ont fine revelant informations.  
My website : omsistuff.ga / omsistuff.rf.gd  
And the ID of the modal button : #feedback-dialog

Thx.

---

<div class="post-metadata">

**Author:** ![UnknownLolz](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/unknownlolz/32/14581_2.png) [@UnknownLolz](https://forum.infinityfree.com/u/UnknownLolz)\
**Post date:** [May 4, 2020, 10:22pm UTC](https://forum.infinityfree.com/t/ajax-response-error/29546/2 "2020-05-04T22:22:07Z")

</div>

Hello there,

Sending mails here using PHP mail() is strictly forbidden because it uses too much server resources.

See this article for more details:  
[https://infinityfree.net/support/php-mail/](https://infinityfree.net/support/php-mail/)

---

<div class="post-metadata">

**Author:** ![Aryqs-Ipsum](https://forum.infinityfree.com/letter_avatar/aryqs-ipsum/32/5_5575768a8748004e209b776fc1b2916d.png) [@Aryqs-Ipsum](https://forum.infinityfree.com/u/Aryqs-Ipsum)\
**Post date:** [May 4, 2020, 10:31pm UTC](https://forum.infinityfree.com/t/ajax-response-error/29546/3 "2020-05-04T22:31:21Z")

</div>

Hello, I forgot to specify this but I use PHP mailer and it’s work without AJAX.  
Otherwise, that’s the request response in my localhost vs the online version :  
 ![image](https://forum-cdn.infinityfree.net/original/2X/6/6f21cc5b6b057dfde664487e3680b13fc56e5665.png) ![image](https://forum-cdn.infinityfree.net/original/2X/d/d0eda6b9b75dfeda9b1e8b60e94fd2667917417a.png)

---

<div class="post-metadata">

**Author:** ![UnknownLolz](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/unknownlolz/32/14581_2.png) [@UnknownLolz](https://forum.infinityfree.com/u/UnknownLolz)\
**Post date:** [May 4, 2020, 10:42pm UTC](https://forum.infinityfree.com/t/ajax-response-error/29546/4 "2020-05-04T22:42:33Z")

</div>

As far as what I’m aware sending emails using PHP is not allowed and won’t work here because it uses to much server resources.  
I saw that PHP Mailer has some options to choose on how your emails will be sent, it could be mail() and SMTP, but mail() is strictly forbidden here.

---

<div class="post-metadata">

**Author:** ![Aryqs-Ipsum](https://forum.infinityfree.com/letter_avatar/aryqs-ipsum/32/5_5575768a8748004e209b776fc1b2916d.png) [@Aryqs-Ipsum](https://forum.infinityfree.com/u/Aryqs-Ipsum)\
**Post date:** [May 4, 2020, 10:45pm UTC](https://forum.infinityfree.com/t/ajax-response-error/29546/5 "2020-05-04T22:45:28Z")

</div>

Sending emails has worked very well for me for a long time, using PHP mailer. I followed the guide proposed on this same forum. The question being, in localhost, I manage to get an response from my php file, but here, I don’t even have an error response. And I wanted to know why?

---

<div class="post-metadata">

**Author:** ![UnknownLolz](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/unknownlolz/32/14581_2.png) [@UnknownLolz](https://forum.infinityfree.com/u/UnknownLolz)\
**Post date:** [May 4, 2020, 10:56pm UTC](https://forum.infinityfree.com/t/ajax-response-error/29546/6 "2020-05-04T22:56:02Z")

</div>

> [@Aryqs-Ipsum](#):
>
> Sending emails has worked very well for me for a long time, using PHP mailer.

You mean it has worked for your here for a long time? If that’s not what you meant then PHP Mailer won’t work here if you are using the mail() option which is **strictly forbidden** here.

> [@Aryqs-Ipsum](#):
>
> The question being, in localhost, I manage to get an response from my php file, but here, I don’t even have an error response.

Not really sure about that but it’s probably because the security system blocked that request since it identified you’re using php mail().

---

<div class="post-metadata">

**Author:** ![Aryqs-Ipsum](https://forum.infinityfree.com/letter_avatar/aryqs-ipsum/32/5_5575768a8748004e209b776fc1b2916d.png) [@Aryqs-Ipsum](https://forum.infinityfree.com/u/Aryqs-Ipsum)\
**Post date:** [May 4, 2020, 10:57pm UTC](https://forum.infinityfree.com/t/ajax-response-error/29546/7 "2020-05-04T22:57:29Z")

</div>

I’m using SMTP gmail server so it’s good and authorized.

---

<div class="post-metadata">

**Author:** ![anon19508339](https://forum.infinityfree.com/letter_avatar/anon19508339/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon19508339](https://forum.infinityfree.com/u/anon19508339)\
**Post date:** [May 5, 2020, 6:26am UTC](https://forum.infinityfree.com/t/ajax-response-error/29546/8 "2020-05-05T06:26:58Z")

</div>

From where are you sending Ajax request Exactly? ` ERR_FAILED` means that it is denying your AJAX, it’s either internet problem or your sending request from another domain.

---

<div class="post-metadata">

**Author:** ![Aryqs-Ipsum](https://forum.infinityfree.com/letter_avatar/aryqs-ipsum/32/5_5575768a8748004e209b776fc1b2916d.png) [@Aryqs-Ipsum](https://forum.infinityfree.com/u/Aryqs-Ipsum)\
**Post date:** [May 5, 2020, 7:27am UTC](https://forum.infinityfree.com/t/ajax-response-error/29546/9 "2020-05-05T07:27:26Z")

</div>

When I’m on my https url, the script not work, and get this error, but in http url, I get a 302 found. And my Ajax request is on the same domain.

---

<div class="post-metadata">

**Author:** ![Aryqs-Ipsum](https://forum.infinityfree.com/letter_avatar/aryqs-ipsum/32/5_5575768a8748004e209b776fc1b2916d.png) [@Aryqs-Ipsum](https://forum.infinityfree.com/u/Aryqs-Ipsum)\
**Post date:** [May 5, 2020, 7:56am UTC](https://forum.infinityfree.com/t/ajax-response-error/29546/10 "2020-05-05T07:56:53Z")

</div>

OK, I found my error, I’ve a rewrite rules on my site, that remove extensions name. I just need to remove .php in this line :  
`'/php/lib/bugreport.php',`  
And know, all working fine. Thanks anyway for your answers.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [May 20, 2020, 7:56am UTC](https://forum.infinityfree.com/t/ajax-response-error/29546/11 "2020-05-20T07:56:55Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
