This is my script for checkout.php
<?php
// This is the registration page for the site.
// Set the page title and include the HTML header.
$page_title = 'Confirmation';
if (isset($_POST['submit'])) { // Handle the form.
// Register the user in the database.
require_once ('./mysql_connect.php'); // Connect to the db.
// Create a function for escaping the data.
function escape_data ($data) {
global $dbc; // Need the connection.
if (ini_get('magic_quotes_gpc')) {
$data = stripslashes($data);
}
return mysql_real_escape_string($data, $dbc);
} // End of function.
$message = NULL; // Create an empty new variable.
// Check for the account number.
if (empty($_POST['account_no'])) {
$aa = FALSE;
$message .= '<p>You forgot to enter your account number!</p>';
} else {
$aa = escape_data($_POST['account_no']);
}
if (empty($_POST['token'])) {
$t = FALSE;
$message .= '<p>You forgot to enter your reference ID!</p>';
} else {
$t = escape_data($_POST['token']);
}
if (empty($_POST['name'])) {
$n = FALSE;
} else {
$n = escape_data($_POST['name']);
}
if (empty($_POST['address'])) {
$ad = FALSE;
} else {
$ad = escape_data($_POST['address']);
}
if (empty($_POST['postcode'])) {
$p = FALSE;
} else {
$p = escape_data($_POST['postcode']);
}
if (empty($_POST['state'])) {
$s = FALSE;
} else {
$s = escape_data($_POST['state']);
}
if (empty($_POST['country'])) {
$c = FALSE;
} else {
$c = escape_data($_POST['country']);
}
if ( $aa && $t ) { // If everything's OK.
// Make sure the token available.
$query = "SELECT * FROM customer_bank WHERE token_id = '$t' ";
$result = @mysql_query ($query);
if (mysql_num_rows($result) == 0) { // Available.
// Add the user.
$query = "INSERT INTO view (account_no, token, name, address, postcode, state, country) VALUES ( '$aa','$t','$n','$ad','$p','$s','$c' )";
$result = @mysql_query ($query); // Run the query.
// Retrieve all of the information for the prints in the cart.
$variable = $_SESSION['cart'];
$query1 = "INSERT INTO view (product_id) VALUES ('$variable')";
$result1 = mysql_query ($query1);
if ($result && $result1) { // If it ran OK.
// Successful add the new customer.
echo '<h3>Successful the transaction</h3>';
include ('includes/header_bank.html');
exit();
} else { // If it did not run OK.
// Send a message to the error log, if desired.
echo '<p><font color="red" size="+1">Cannot complete the transaction due to a system error. We apologize for any inconvenience.</font></p>';
}
} else { // The account number already exist.
echo '<p><font color="red" size="+1">The account number already in the database</font></p>';
}
mysql_close(); // Close the database connection.
} else { // If it did not run OK.
$message = '<p>Please try again.</p>';
}
} // End of the main Submit conditional.
// Print the error message if there is one.
if (isset($message)) {
echo '<font color="red">', $message, '</font>';
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>"method="post">
<fieldset><legend>Enter the reference id that you get request from the server with the account number that register with this website:</legend>
<p><b>Account number:</b> <input type="text" name="account_no" size="50" maxlength="50" value="<?php if (isset($POST['account_no'])) echo $POST['account_no']; ?>" /></p>
<p><b>Reference ID:</b> <input type="text" name="token" size="20" maxlength="20" value="<?php if (isset($POST['token'])) echo $POST['token']; ?>" /></p>
</fieldset>
<fieldset><legend>Enter the billing information correctly so that the product can delivered</legend>
<p><b>Recipient Name:</b> <input type="text" name="name" size="20" maxlength="20" value="<?php if (isset($POST['name'])) echo $POST['name']; ?>" /></p>
<p><b>Address:</b> <input type="text" name="address" size="50" maxlength="50" value="<?php if (isset($POST['address'])) echo $POST['address']; ?>" /></p>
<p><b>Postcode:</b> <input type="text" name="postcode" size="5" maxlength="5" value="<?php if (isset($POST['postcode'])) echo $POST['postcode']; ?>" /></p>
<p><b>State:</b> <input type="text" name="state" size="10" maxlength="10" value="<?php if (isset($POST['state'])) echo $POST['state']; ?>" /></p>
<p><b>Country:</b> <input type="text" name="country" size="10" maxlength="10" value="<?php if (isset($POST['country'])) echo $POST['country']; ?>" /></p>
</fielset>
<div align="center"><input type="submit" name="submit" value="Confirmation" /></div>
</form><!-- End of Form -->
<?php
include ('includes/footer_home.html');
?>
Why when I want to execute it appear this error
Notice: Undefined variable: _SESSION in C:\Program Files\Apache Group\Apache2\htdocs\checkout.php on line 91
I want the data that I stored based on the view_cart.php to be insert into table view?