I think the problem is in
segment is :
$query2 = "INSERT INTO view (account_no, token_id, name, address, postcode, state, country) VALUES ( '$aa','$t','$n','$ad','$p','$s','$c' )";
mysql_query($query2) or die(mysql_error());
because variable written between ' ' will not be parsed by php
You should try "$aa","$t" etc.
I hope your problem will be solved.