Location: PHPKode > projects > DDL CMS > Upload these files to your webspace/admin/backupdb.inc
									<h2>Backup Database</h2>
<?php
	if(isset($_POST) && is_array($_POST) && count($_POST) > 0 && array_key_exists('sub', $_POST))
	{
?>
									<p>Backing up database:  <?php echo MYSQLDB; ?>...</p>
<?php
	$dateStamp = date('Y-m-d_H-i-s');
	exec('mysqldump -u ' . MYSQLUSER . ' -h ' . MYSQLHOST . ' ' . MYSQLDB . ' ' . '--password="' . MYSQLPASSWD . '" > ' . BASEDIR . 'backups/' . MYSQLDB . '_' . $dateStamp . '.sql');
	chmod(BASEDIR . 'backups/' . MYSQLDB . '_' . $dateStamp . '.sql', 0666);
?>
									<p>Dump was written to file:</p>
									<p><?php echo BASEDIR . 'backups/' . MYSQLDB . '_' . $dateStamp . '.sql'; ?></p>
<?php
	}
	else
	{
		if(function_exists('exec') === TRUE)
		{
?>
									<p>Click here to backup the database now:</p>
									<form action="ddl.php?go=backupdb" method="post">
										<input type="submit" value="Backup DB" name="sub" />
									</form>
<?php
		}
		else
		{
?>
									<p>Unable to create backup file because exec() is disabled on this server.</p>
<?php
		}
	}
?>
Return current item: DDL CMS