Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:10526007
Created Apr 12, 2014

<head>
<script src="//code.jquery.com/jquery-1.4.min.js">
</script>
</head>
<body>
<pre><?php
//** IMPORTANT TO ALLOW CORS **
header("Access-Control-Allow-Origin: *");
print_r($_POST);
print_r(file_get_contents("php://input"));
?></pre>
<script>
jQuery.post("http://127.0.0.1/cors.php","BASE64ENCODEDSTRING", function(d,s){console.log(d);});
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment