私はphpファイルを指すフォームを持っています。すべてのphpファイルは、ユーザーを特定のページ。私はそれが動作するように取得するように見えるではないと私が間違っているの何イム確認することはできません。私はcan not get header( "Location:http://www.google.com/"):
<form method="post" action="processRegister.php">
User Name: <input type="text" name="userName" maxlength="32"><br>
Password: <input type="password" name="userPassword" maxlength="32"><br>
<input type="submit">
</form>
processRegister.php
<?php
// processRegister.php
//////////////////////
header("Location: http://www.google.com/");
/*
// First include the class definition
include('UserClass.php');
// Next, create an instance of the class
$newUser = new User;
// Call the registerUser() method, passing in the required variables
if ($newUser->registerUser($userName, $userPassword)) {
header('Location: www.google.com');
}
else {
header('Location: www.yahoo.com');
}
*/
?>
このエラーは何ですか? header()コマンドの前にデータが送られましたか? –
'<?'を '<?php'に変更してみてください。 – ceejayoz
これはタイプミスか問題ですか?あなたのフォームは 'process_register.php'を使っていますが、あなたが与えたファイル名は' processRegister.php'です。 – ughoavgfhw