<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
require "dbconnect.php";
if (isset ($_POST['eptmima'])) {
	$tm1=$_POST['tmim'];
echo "Έχετε επιλέξει το τμήμα:".$tm1;
$sql = mysqli_query($con,"SELECT kmathiti FROM allstudentinfo WHERE tmima='$tm1' " );
$c=mysqli_num_rows($sql);
echo "<br>";
echo "θα σταλούν ".$c. " μηνύματα";	 
$i=1;
while ($row = mysqli_fetch_array($sql)) 
    {
	if ($row['kmathiti'] <> "") {$tsms[$i]=$row['kmathiti'];}
   	$i++;
	
    }
	
	$sms=$_POST['sms'];
	$_SESSION['tel']=$tsms;
	$_SESSION['sms1']=trim($sms);
	echo "sending sms";
	
	include "smssecret.php";     


}	
	
?>	
</body>
</html>