WEBデザイン初心者です。データベースをセットアップしており、PHP を使用してデータベースにフォーム データを挿入したいだけです。私はこれらのようなコードを持っていますが、送信ボタンをクリックすると PHP コードページに移動します。助けが必要。ありがとう
<!DOCTYPE html>
<html>
<body>
<form name="input" action="test.php" method="post">
First name: <input type="text" name="FirstName" value="Mickey"><br>
Last name: <input type="text" name="LastName" value="Mouse"><br>
<input type="submit" value="Submit">
</form>
<?php
if(isset($_POST['sumit'])){
$Fname=$_POST['FirstName'];
$Lname=$_POST['LastName'];
mysql_connect("server", "xxxxxx", "xxxxxx") or die(mysql_error());
mysql_select_db("test_name") or die(mysql_error());
mysql_query("INSERT INTO `FirstName`,'LastName' VALUES ('$Fname', '$Lname')");
Print "Your information has been successfully added to the database."; }
?>
<p>If you click the "Submit" button, the form-data will be sent to a my test table test_name.</p>