<?php require('../_class/config.php'); ?>
<?php if(isset($_POST['frm']) and $_POST['frm']=='frmMessages'){
	$ad = DB::control($_POST['ad'], 'text'); 
	$soyad = DB::control($_POST['soyad'], 'text'); 
	$sinif = DB::control($_POST['sinif'], 'text'); 
	$okul = DB::control($_POST['okul'], 'text'); 
	$tc = DB::control($_POST['tc'], 'text'); 
	$veli_ad = DB::control($_POST['veli_ad'], 'text'); 
	$veli_soyad = DB::control($_POST['veli_soyad'], 'text'); 
	$veli_telefon = DB::control($_POST['veli_telefon'], 'text'); 
	$link =  DB::control(DB::seo($_POST['tc']),'text');

	$result = DB::insert("INSERT INTO messages(ad, soyad, sinif, okul, tc, veli_ad, veli_soyad, veli_telefon, link ) VALUES($ad, $soyad, $sinif, $okul, $tc, $veli_ad, $veli_soyad, $veli_telefon, $link)");
	if($result){ 
		echo '<div class="alert alert-success text-center clearfix"><i class="fa fa-check"></i> Başvurunuz tamamlanmıştır. Sınav giriş belgenizi almayı unutmayınız !</div>';
	}else{
		echo '<div class="alert alert-danger text-center clearfix"><i class="fa fa-times"></i> Bir hata oluştu!</div>';
	
	} 

   
	echo "<script>setInterval(function(){ window.location.href='sonuc/$tc'; }, 1000);</script>";
	 
} ?>
gelen tc bu şekilde