Request from another server

hi, how i allow post request from another server\site
my .htaccess :

Header set Access-Control-Allow-Origin “*”

my PHP :

<?php header("Access-Control-Allow-Headers: Authorization, Content-Type"); header("Access-Control-Allow-Origin: *"); header('content-type: application/json; charset=utf-8'); what im missing?

https://infinityfree.net/support/javascript-error-using-api-or-mobile-android-app/

3 Likes

Hi, i just need to get post request from another server so its means i cant?

No you cannot. Sadly

2 Likes

Use that htaccess if you are owner the server & its resources.

For example you have a font file in your own server. Then your friends want to use that font on their site.
Without that htaccess code, your friends can’t use your font.
You can put that code to your htaccess file (root folder/main domain for that font) to allow public to access it.

But if you aren’t owner the server & its resources or you just want to use other people resources, you must ask that server owner to put that code on their server or download the resources then upload to your own server.

Thank you, i get it now greate answer bro! :heart_eyes:

I didn’t know that btw. Good to know :smiling_face_with_three_hearts:

1 Like

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