# Access-Control-Allow-Origin header

**URL:** <https://forum.freecodecamp.org/t/access-control-allow-origin-header/185435>\
**Category:** General\
**Created:** [April 13, 2018, 12:35pm UTC](https://forum.freecodecamp.org/t/access-control-allow-origin-header/185435 "2018-04-13T12:35:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mafrax](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@mafrax](https://forum.freecodecamp.org/u/mafrax)\
**Post date:** [April 13, 2018, 12:35pm UTC](https://forum.freecodecamp.org/t/access-control-allow-origin-header/185435/1 "2018-04-13T12:35:32Z")

</div>

Hey boys im trying to do the first challenge where we need to create a random quote button.  
Problem is when i try to access my json file which is in the same folder than my php and js file, i have an error about Access-Control-Allow-Origin header which i added to my php file “\<?php header("Access-Control-Allow-Origin:\*"); ?\>”.  
If anyone can help , Thanks a lot !

---

<div class="post-metadata">

**Author:** ![mafrax](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@mafrax](https://forum.freecodecamp.org/u/mafrax)\
**Post date:** [April 13, 2018, 1:32pm UTC](https://forum.freecodecamp.org/t/access-control-allow-origin-header/185435/2 "2018-04-13T13:32:45Z")

</div>

Sorry its okay i forgot to launch the php file in localhost …

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:23pm UTC](https://forum.freecodecamp.org/t/access-control-allow-origin-header/185435/3 "2021-01-17T20:23:26Z")

</div>

Closed on January 17, 2021, 8:23pm UTC


