我的PHP脚本存在问题,因为它没有从我正在使用的其他网络域发送必要的POST数据。基本上,正在发生的是我运行并加载脚本A,然后脚本A将POST数据的有效负载发送到脚本B并启动它,但脚本B没有从脚本A接收任何内容。
这两个脚本位于不同的域(https://www.somethingA.com vs http://www.somethingB.com),因此这使我假设它是一个跨域问题,并且由于跨域安全限制而被阻止。这是这种情况吗?
感谢大家的帮助。
编辑:
这是我的代码:
脚本A
<form method="post" id="myform" name="myform" action="http://www.somethingB.com" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="lis_result_sourcedid" value="9e45315-4566-351e">
<input type="hidden" name="lis_outcome_service_url" value="https://outcome-service-url.com">
<input type="hidden" name="lti_message_type" value="basic-lti-launch-request">
<input type="hidden" name="oauth_version" value="1.0">
<input type="hidden" name="oauth_nonce" value="974512358">
<input type="hidden" name="oauth_timestamp" value="1563511254">
<input type="hidden" name="oauth_signature_method" value="HMAC-SHA1">
<input type="hidden" name="oauth_consumer_key" value="print">
<input type="hidden" name="oauth_callback" value="about:blank">
<input type="hidden" name="oauth_signature" value="oaijAweiojawewfaw=">
<input type="submit" name="basiclti_submit" value="Launch Endpoint with BasicLTI Data">
</form>
</div>
<script>
document.getElementById('ltiLaunchFormSubmitArea').style.display = 'none';
nei = document.createElement('input');
nei.setAttribute('type', 'hidden');
nei.setAttribute('name', 'basiclti_submit');
nei.setAttribute('value', 'Launch Endpoint with BasicLTI Data');
document.getElementById('myform').appendChild(nei);
document.myform.submit();
</script>
</body>
</html>
...和脚本B
print_r($_REQUEST);