okay, tried both suggestions. The first one, use isempty instead of isset, gives this error message "Call to undefined function: isempty()". And I can't find anything with isempty related to PHP, but I could be missing it.
The other one. I don't get anything. I still get the same problem. But I don't get an error either. I'm not sure what I'm missing with this command. I put it where I was sure it was supposed to go.
<?php
session_start();
// Connect
require_once ("/config.inc");
if (isset($_POST["sel_item_id"])) {
$get_iteminfo_sql = "SELECT product_name FROM product WHERE product_num = '".$_POST["sel_item_id"]."'";
$get_iteminfo_res = mysql_query($get_iteminfo_sql, $db_connection) or die (mysqli_error());
if (mysql_num_rows($get_iteminfo_res) < 1) {
header("Location: seestore.php");
exit;
} else {
while ($item_info = mysql_fetch_array($get_iteminfo_res)) {
$product_name = stripslashes($item_info['product_name']);
}
$addtocart_sql = "INSERT INTO shopping_cart
(session_id, sel_item_id, sel_item_qty, date_added)
VALUES ('".$_COOKIE["PHPSESSID"]."',
'".$_POST["sel_item_id"]."',
'".$_POST["sel_item_qty"]."', CURDATE())";
$addtocart_res = mysql_query($addtocart_sql, $db_connection) or die (mysql_error());
session_write_close();
header("Location: showcart.php");
exit;
}
}else{
header("Location: seestore.php");
exit;
}
?>
<?php echo $display_block; ?>