<?php
	session_start();
	include_once"includes/conn.php";
	include_once"functions/Error.php";
	// a7oVR+imzld{

	if (isset($_POST['Submit'])) {
		$TN = mysqli_real_escape_string($conn,strip_tags($_POST['TN']));

		if (empty($TN)) {
			$_SESSION['er'] = 'emp';
			header('Location: index.php');
		}else{
			$sql = "SELECT * FROM details WHERE TrackNum = '$TN' ";
			$result = mysqli_query($conn, $sql) or die("Could not connect to Database").mysqli_connect_error();
			$resultCheck = mysqli_num_rows($result);

			if ($resultCheck > 0) {
				$_SESSION['id'] = $TN;
				header('Location: shipping_details.php');
			}else{
			$_SESSION['er'] = 'inv';
			header('Location: index.php') or die("Could not connect to Database").mysqli_connect_error();;
			}
		}
				
	}

?>