<?php 
include "scrinit.php";
require("dbconnect.php");
if (isset($_POST['adsynd']))
{   
    $snd=$_POST['syndx'];
	$id=$_POST['nextid'];
	$pmp=$_POST['pmpx'];
	$teach=$_POST['teachx'];
	$sql = $dbcon->prepare("INSERT INTO syndcodes (syndid,pmp,kathigitis,synd) values (?,?,?,?) ");
	$sql->execute([$id,$pmp,$teach,$snd]);	
}	
echo '<script type="text/javascript">';
   echo 'alert("Η Συνδιδασκαλία καταχωρήθηκε")';
   echo '</script>';	
   $time = 0.2; //Time (in seconds) to wait. 
   $url = "addsynd.php";//Location to send to. 
   header("Refresh: $time; url=$url");