<?php
function check_input($data)
{
    $data = trim($data);
    $data = htmlspecialchars($data);
    return $data;
}
$f1 = check_input($_POST['rn']);
$f2    = check_input($_POST['tn']);
$f3   = check_input($_POST['ts']);
//$f4    = check_input($_POST['fi']);
$f5    = check_input($_POST['dt']);
//$f6    = check_input($_POST['at']);
$f7   = check_input($_POST['bo']);
//$f8 = check_input($_POST['do']);
$f9 = check_input($_POST['edt']);
$f10 = check_input($_POST['dto']);
$f11 = check_input($_POST['i']);
$f12 = check_input($_POST['tw']);
$f13 = check_input($_POST['st']);
//$f14 = check_input($_POST['sf']);
$f15 = check_input($_POST['sa']);
$f16 = check_input($_POST['ba']);
$f17 = check_input($_POST['ps']);
$db=mysql_connect("localhost", "goldendesk_is", "60803144_ME");
mysql_select_db('goldendesk_if',$db);
mysql_query("INSERT INTO clients(id,Receipt_No,Tracking_No,Tracking_Statut,Dep_Time,Billed_On,EDT,Delivered_To,Items,Total_weight,Service_Type,Shipping_Adr,Billing_Adr,Payment_Statut) VALUES('','$f1','$f2','$f3','$f5','$f7','$f9','$f10','$f11','$f12','$f13','$f15','$f16','$f17')") or die(mysql_error());
$confirm = mysql_query("SELECT clients.Receipt_No FROM clients")or die(mysql_error());
$numrows = mysql_num_rows($confirm);
if($numrows != 0)
			{
				header('Location: thankyou.html');
			}
			else 
			{   
				die("Please Try again! DATA UNSAVED ");
			} 
mysql_close();
?>