<?php

//  $link =  mysqli_connect('host','db user','password','db name') or exit('error');

    $link =  mysqli_connect('localhost','ivtri_user','Suda@1965#','ivtri_cpd') or exit('error');
		

if(isset($_POST['reg1'])){
	$hd=$_POST['hd'];
	$name=$_POST['lname'].' '.$_POST['fname'];
	$email=$_POST['email'];
	$cell=$_POST['cell'];
	$degree=$_POST['degree'];
	$city=$_POST['city'];
	$mmc=$_POST['mmc'];

    $date = date_default_timezone_set('Asia/Kolkata');
    $today=getdate();
    $pid=$today['mday']."".$today['mon']."".$today['year']."".$today['hours']."".$today['minutes']."".$today['seconds'];
  
    
   $sql=" INSERT INTO `cardio` (`pid`, `hd`, `name`, `email`, `cell`, `degree`, `city`, `mmc`) VALUES ('$pid', '$hd', '$name', '$email', '$cell', '$degree', '$city', '$mmc');";
				
//			 echo $sql; exit;	


		$result = mysqli_query($link, $sql) or die( Header( "Location: failed.html" ) ); 

mysqli_close($link);
}
// echo "Registration Successfull"; 
header('Location:confirmed.html');



?>