All pastes #470604 Raw Edit

Someone

public php v1 · immutable
·published 2007-05-04 11:36 UTC
rendered paste body
<?phpsession_start();?><?php	require("/home/sreynold/public_html/config/db_config.php");	$conn = mysql_connect($db_host, $db_user, $db_password) or die(mysql_error());	$db= mysql_select_db($db_name, $conn) or die ("Couldn’t select database");		if (isset ($_POST['quantity']) && !empty($_POST['quantity'])){				$flight = $_POST['flight_picked'];								$query = "SELECT to_city FROM flights WHERE route_no is '$flight'";					$to_city = mysql_query($query);								echo $to_city;				mysql_close($conn);	                $from_city=$_POST['from_city'];                $quantity_picked = $_POST['quantity'];		$flightprice =$_POST['price'];		$lineprice = $quantity_picked * $flightprice;		echo (isset($_SESSION['shoppingcart'])) ? 'We Are Now Adding That Flight to Your Shopping Cart<br>' : 'We Are Now Creating A New Shopping Cart for You<br>';                $_SESSION['shoppingcart'][] = array(                                "route" =>$flight,                                "to_city" =>$to_city,                                "from_city" =>$from_city,			        			"quantity" =>$quantity_picked,								"price" =>$flightprice,								"lineprice" =>$lineprice,																				);		echo "No of different flights currently stored in session = ".count($_SESSION['shoppingcart']);}else		{			echo	"No Flights to add<br>at the moment 			(You didn't select a quantity<br>";		}?><br><a href="unreg.php">Unregister Session</a><br><a href="shoppingcart.php" target="Area4">View Cart</a><br>