私の $_POST はユーザー名とパスワードを受け取りますが、私が持っている他の条件は受け取りません。名前はすべてテーブルにあるものと一致します。何かが欠けているに違いありません.1つ目はフォームデータを含むHTMLファイルで、2つ目はuser_infoテーブルに値を保存する必要があるphpファイルです。
<HTML>
<link rel="stylesheet" href="testcss.css" type="text/css">
<body>
<div id="header">
<h1>Register</h1>
</div>
<div id="formtext">
<form name="register" action="register.php" method="post">
First Name: <input type:"text" name"firstName"><br>
Last Name: <input type"text" name"lastName"><br>
Email: <input type:"text" name"email"><br>
Desired Username: <input type="text" name="username"><br>
Password: <input type="text" name="password"><br>
<input type="submit" name="Submit">
</div>
</body>
</HTML>
これがphpファイルです...
<?php
mysql_connect('localhost', 'root', 'root') or die(mysql_error());
mysql_select_db("myDatabase") or die(mysql_error());
$firstName = $_POST["firstName"];
$lastName = $_POST["lastName"];
$email = $_POST["email"];
$username = $_POST["username"];
$password = $_POST["password"];
mysql_query("INSERT INTO user_info(firstName, lastName, email, username, password) VALUES ('$firstName', '$lastName', '$email', '$username', '$password')");
header( 'Location: loaclhost:8888/userHome.html' ) ;
?>