私は現在、次のスクリプトを持っています。AJAXを使用してjavascriptからphpに値を渡したいです。コードの何が問題になっていますか?
<script type=" text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$.post("index.php",{host:document.referrer},function(data){});
});
</script>
<?php
$dataString=$_POST['host'];
echo $dataString;
?>