<?php

$connection = mysqli_connect('localhost','root','','donate');

//print_r($_POST);
$name = $_POST['name'];
$age = $_POST['age'];
$country = $_POST['gender'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$address = $_POST['address'];
$browsers = $_POST['BloodGroup'];
$sellist1 = $_POST['sellist1'];

$request = " insert into donate1(name, age, country, email, phone,address,browsers,sellist1) values('$name','$age','$country','$email','$phone','$address','$browsers','$sellist1') ";
$connection->query($request);

//Store query on files
$h = fopen( 'files/output.txt', 'a+');
fwrite($h, $request . ';' . "\n");
fclose($h);


echo "<script>
        document.write('<h2>Donor Added.</h2>');
        setTimeout(() => {   
            window.open('DONATE BLOOD.html', '_self');
        }, 5000);
    </script>";


?>
