Blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource

Username ( epiz_30046210)

URL: https://ume.epizy.com
You can check the console for the error

Error Message

Access to XMLHttpRequest at ‘htt ps ://infinityfree. net/errors/403/’ (redirected from ‘http://ume .epizy .com/chat.php’) from origin ‘h ttp://ume .epizy .com’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Other Information

index.php =>

< html>

< script src="jquery-3.5.0.min.js"> < body>

< script>
$(document).ready(function() {
$.ajax({
type: “GET”,
url: “chat.php”,
dataType: “html”, //expect html to be returned
success: function(response){
$(“#chatPP”).html(response);
}
});
setInterval(function(){
$.ajax({
type: “GET”,
url: “chat.php”,
dataType: “html”, //expect html to be returned
success: function(response){
$(“#chatPP”).html(response);
}
});
},500);
});
< /script>

                                        <div id="chatPP"></div>

</ body>
</ html>

chat.php=>

<?php header("Access-Control-Allow-Origin: http://ume.epizy.com"); $conn = mysqli_connect("**************","epiz_30046210","***********","************"); $res = mysqli_query($conn,"SELECT * FROM table"); while($r = mysqli_fetch_array($res)){ echo $r['msg']; } ?>

How can I get rid of this error? I’ve tried in various ways but couldn’t solve this problem. Is there any solution? If any, please let me know.

Hello!

Please note that chat scripts are not allows on Free hosting, and since the system detected you are attempting to use one, it has displayed that error.

Please let me know if you have any questions!

4 Likes
  1. As mentioned by @Greenreader9.
  2. You’ll encounter that error due to the hard core security system here.

Yeah, my session is being deleted automatically. How can I solve this?

You can’t solve this. It’s against the TOS. If you want to host such script, upgrade to premium hosting.

Since chat scripts are not allowed, this cannot be ‘solved’. However, you can use a third party live chat provider, as long as the chat script is not hosted on InfinityFree servers.

2 Likes

Premium also does not allow chat

5 Likes

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