把javascript里面的变量传给php
<body>
<script>
function winopen(str)
{
location.href="1.php?str="+str;
}
</script>
<input type="button" onclick="winopen('传个值试试')" value="传值">
<?php
if(isset($_GET['str'])&&$_GET['str']!="")
{
echo $_GET['str'];
}
?>
</body>