<style type="text/css">
.waiting { cursor: wait; }
</style>

<style>
.loader {
  border: 16px solid #f3f3f3; border-radius: 50%; border-top: 16px solid #3498db;
  width: 120px;  height: 120px;
  -webkit-animation: spin 2s linear infinite; /* Safari */
  animation: spin 2s linear infinite;
/* ==== CENTER PAGE ====*/  
  margin: 0; position: absolute; top: 50%; left: 50%;
  -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%);
  top: 40%;  -ms-transform: translateY(-30%); transform: translateY(-30%); 
}

/* Safari */
@-webkit-keyframes spin {
  0% { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
</style>
 
<div class="loader"> </div>


<?php
session_start();
include 'myFunctions.php';

$dbhost =$_SESSION['DB_SERVER'];
$dbuser =$_SESSION['DB_USERNAME'];
$dbpass =$_SESSION['DB_PASSWORD'];
$dbname =$_SESSION['DB_NAME'];
 
 //Connects to mysql server
    $conn = mysqli_connect($dbhost,$dbuser,$dbpass,$dbname);
$filename = $dbname .'_'. date("Y-m-d-His") . '.sql';
    $mime = "application/x-gzip";

header( "Content-Type: " . $mime );
header( 'Content-Disposition: attachment; filename="' . $filename . '"' );

$cmd = "mysqldump.exe -u $dbuser --password=$dbpass $dbname ";   
 
passthru( $cmd );

exit(0);


?>