SET UP: Windows vista
XAMPP 1.7.3,
Apache 2.2.14 (IPv6 enabled) + OpenSSL 0.9.8l
MySQL 5.1.41 + PBXT engine
PHP 5.3.1
phpMyAdmin
After entering various different information from previous forms on different pages I finally get this error message "Parse error: syntax error, unexpected T_STRING in C:\blablah on line 31" on the following code:
<?php
//let's start our session, so we have access to stored data
session_start();
include 'db.inc.php';
$db = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) or
die ('Unable to connect. Check your connection parameters.');
mysql_select_db(MYSQL_DB, $db) or die(mysql_error($db));
//let's create the query
$query = 'INSERT INTO subscriptions (name, email_address, membership_type, terms_and_conditions,
name_on_card,
credit_card_number, credit_card_expiration_data)
VALUES (
"' . $_SESSION[$name, $db] . '",
' . $_SESSION[$email_address, $db] . '",
' . $_SESSION[$membership_type, $db] . '",
' . $_SESSION[$terms_and_conditions, $db] . '",
' . $_POST[$name_on_card, $db] . '",
' . $_POST[$credit_card_number, $db] . '",
' . $_POST[$credit_card_expiration, $db] . ')';
if (isset($query)) {
$result = mysql_query($query, $db) or die(mysql_error($db));
}
?>
<p>Done!</p>
</body>
</html>
?>
Any help would be appreciated. I'm practicing this with the ambition to develop a multi-page registration using sessions for a website so even web pages that might help me with this aim would be good.