swine flu forms


In wake of the newly spread epidemic of Swine Flu, international airports started registration forms swine flu. I came across it when my sister, coming from the US, had to wait 2 hrs. at immigrations becasue of this form. It asks you whether you have swine flu or not?. I wonder if anyone will reply 'YES' to that.....

Since, i am working on designing web related apps in php, I decided to create an online form of this registration form.

here's the code of the backend php file:


mysql_connect('localhost','root','*****') or die("Unable to connect");
while(!(mysql_select_db('swineflu')))
mysql_query("CREATE DATABASE swineflu");
$query="CREATE TABLE medreport (name varchar(20), nation varchar(20), med_note varchar(40), relative varchar(20), comment varchar(40),swine int)";
mysql_query($query);

//inserting values

$name=$_POST['app_name'];
$nation=$_POST['app_nation'];
$medhis=$_POST['med_his'];
$rel=$_POST['app_rel'];
$comm=$_POST['app_comm'];
if ($_POST['question'])
{ $swine='1';}
else $swine='0';

$query="INSERT INTO medreport values('$name','$nation','$medhis','$rel','$comm','$swine')";
mysql_query($query);
if(mysql_affected_rows())
{ echo "Your information has been recorded";}
else echo "An error has occured";

if ($swine)
echo "You have been swined";
?>



It gives a dangerous message : You have been swined , if found infected.

All the data goes to a mysql database from where it can be retrieved on authenticating user name and password. I am currently working on it.

1 comments:

Shubhendra Singh said...

wow! when coming from France they just made me fill a form on paper and asked if I had fever, thats it! just 2 minutes, but its good to check people for this flu.

 
Copyright © PRATIK ANAND's weblog.