$_POST
サインアップページでメソッドを使用していくつかのパラメーターを渡すために PHP と JavaScript を使用しようとしています。
しかし、私が得るのは: The email <?php echo $_POST['email']; ?> is about to be registered (account ref = <?php echo $_POST['accountref']; ?>
、基本的にコードです。
私は($_POST
方法で)何か間違っていますか?
スクリプト/signup.js
var accountref = "myaccountref";
window.location.href = 'signup.php?email=' + document.getElementById("signup_email").value + '&user=' + document.getElementById("signup_user").value + '&pass=' + document.getElementById("signup_pass") + '&accountref=' + accountref;
signup.php
<?php
$email;
$user;
$pass;
$accountref;
?>
<script type = "text/javascript">
alert("The email <?php echo $_POST['email']; ?> is about to be registered (account ref = <?php echo $_POST['accountref']; ?>");
</script>