Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

586
Views
How to fix CORS error when getting contents from a website?

There is a CORS error in my code that gets the contents from https://roblox.com/discover to clone the roblox discover page.

My code:

<?php
   echo file_get_contents("https://www.roblox.com/discover");
?>

If I go to console, it says

Access to XMLHttpRequest at 'robloxscript' from origin 'yoursite' 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.

How can I go about fixing this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You cannot do that. Because of security reasons. Different domain. For you to be able to consume that page you will have to fetch the data using a client request and manipulate the dom to get what you want.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!