I'm trying to access another site from my program.php, but it's returning the message:
XMLHttpRequest can not load In 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' link ' is therefore not allowed access.
I've changed the HTML code, but it still keeps returning the same error. HTML code below:
<!DOCTYPE html>
<html>
<head>
<?php
header("Access-Control-Allow-Origin: *");
?>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<title>Projeto Yara Tecnologia</title>
<meta charset="UTF-16">
<style>html {
font-family: Helvetica, Arial, sans-serif;
font-size: 100%;
background: #333;
}
Adding the command <?php header("Access-Control-Allow-Origin: *"); ?>
made no difference!
Is there a correct place to write this command in HTML?
What am I doing wrong?