<?php include 'connection.php';
session_start();
if (!isset($_SESSION['is_logged_in'])) {
    header("Location:login.php");
    die();
    }
	function randomPassword() {
    $alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    $pass = array(); //remember to declare $pass as an array
    $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache
    for ($i = 0; $i < 5; $i++) {
        $n = rand(0, $alphaLength);
        $pass[] = $alphabet[$n];
    }
    return implode($pass); //turn the array into a string
}
$unique_id = randomPassword();

?>

<?php


$consignor_name= $_POST['consignor_name'];
$consignee_name= $_POST['consignee_name'];


		
$query14 = "insert into challan2 (consignor_name,consignee_name) values ('$consignor_name','$consignee_name')";
$r14=mysql_query($query14,$conn);


// echo $qryauto;
// exit();
?> 

<script>
javascript:window.location.href="challan_form2.php";
</script>
