// add2cart.php require( 'config.php' ); require( 'lib.php' ); // session_start(); // if ( ( $login = auth() ) == FALSE ) { header( 'Location: login.php?redirect=add2cart.php?' . urlencode( $_SERVER['QUERY_STRING'] ) ); exit; } // db connect $link = db_connect(); // if ( $_GET['action'] == 'add' ) { $sql = "insert into cart ( date, users_id, item_id, quantity ) values ( '" . date( 'Y-m-d H:i:s' ) . "', '" . mysql_real_escape_string( $_SESSION['users_id'] ) . "', '" . mysql_real_escape_string( $_GET['item_id'] ) . "', '1' )"; $result = mysql_query( $sql ); } ?> require( 'header.php' ) ?> require( 'topbar.php' ) ?>