post
にデータを形成しようとしていますmysql
。しかし、私はすべてのキャラクターに非常に混乱していてうんざりしています. キャラクターが足りないか、キャラクターを追加しすぎたようです。php
このフォームをに渡すのを手伝ってくださいmysql
。
ブラウザーは、次の行エラーに反応します。
"'" . $_POST['credit_card_expiration'] ."',".);
コードは次のとおりです。
<?php
session_start(); // Start session first thing in script
// Script Error Reporting
error_reporting(E_ALL);
ini_set('display_errors', '1');
// Connect to the MySQL database
include "storescripts/connect_to_mysql.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
//let's create the query
$insert_query = "INSERT INTO order (".
"name,".
"email_address,".
"membership_type".
"terms_and_conditions,".
"name_on_card,".
"credit_card_number,".
"credit_card_expiration_data,".
") values
(".
"'" . $_POST['name'] . "', ".
"'" . $_POST['email_address'] . "',".
"'" . $_POST['membership_type'] . "',".
"'" . $_POST['terms_and_conditions'] . "',".
"'" . $_POST['name_on_card'] . "',".
"'" . $_POST['credit_card_number'] . "',".
"'" . $_POST['credit_card_expiration'] ."',".);
//let's run the query
mysql_query($insert_query);
?>
</body>
</html>
私のフォーム:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<form method="post" action="form_process.php">
Name on card:
<input type="text" name="name_on_card"><br />
Credit card number:
<input type="text" name="credit_card_number"><br />
Credit card Expiration date:
<input type="text" name="credit_card_expiration_date"><br />
<input type="hidden" name="name"
value="<?php echo $_POST['name']; ?>">
<input type="hidden" name="email_address"
value="<?php echo $_POST['email_address']; ?>">
<input type="hidden" name="membership_type"
value="<?php echo $_POST['membership_type']; ?>">
<input type="hidden" name="terms_and_conditions"
value="<?php echo $_POST['terms_and_conditions']; ?>">
<input type="submit" value="Submit">
</form>
</body>
</html>