<?php
session_start();
if ($_SESSION['islogin']=='' ) { 
  echo "ΠΡΕΠΕΙ ΝΑ ΕΓΓΡΑΦΕΙΤΕ ΓΙΑ ΝΑ ΧΡΗΣΙΜΟΠΟΙΗΣΕΤΕ ΤΟ ΣΥΣΤΗΜΑ"."<BR>";
  sleep(3);
  header("Location: loginguest.php"); /* Redirect browser */
  exit();
  }

?>
<!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
include "dbconnect.php";
$usr=$_SESSION['usr'];

$pname = $_POST['pname'];
$sname = $_POST['sname'];
$mobn = $_POST['mobn'];
$email = $_POST['email'];
$name=$pname." ".$sname;


mysqli_query($con, "UPDATE parents SET name='$name',phone_number='$mobn',email='$email' WHERE username='$usr' ");

// DISPALY A MESSAGE BOX and return
        echo '<script type="text/javascript">';
        echo 'alert("ΤΑ ΣΤΟΙΧΕΙΑ ΕΧΟΥΝ ΑΛΛΑΧΤΕΙ ΜΕ ΕΠΙΤΥΧΙΑ")';
        echo '</script>';
		$time = 1; //Time (in seconds) to wait. 
        $url = "indexparent.php"; //Location to send to. 
        header("Refresh: $time; url=$url");
		exit();
 ?>


 <br /><br /><br />


</body>
</html>