".I_SQL_ERROR." ";
// check if a db or directory was posted
if (isset($_POST['dirs'])) {
if (is_array($_POST['db']) || is_array($_POST['dirs']) || $_POST['man_dirs']) $selection_ok=TRUE;
else $selection_ok=FALSE;
} elseif($_POST['man_dirs']) {
$selection_ok=TRUE;
} elseif(isset($_POST['db'])) {
if (is_array($_POST['db'])) $selection_ok=TRUE;
else $selection_ok=FALSE;
} elseif(isset($_POST)) {
$selection_ok=FALSE;
}
// generate and print php script
if ($selection_ok) {
// create path to run_scheduled.php
$path_back="";
if (strstr($_SERVER['SCRIPT_NAME'],"\\")) $delimiter="\\"; else $delimiter="/";
$script_path=explode($delimiter,$_SERVER['SCRIPT_NAME']);
$path_d=count(explode("..",$_POST['path']))-1;
$path_u=count(explode($delimiter,$_POST['path']))-$path_d-1;
for ($i=0;$i<$path_u;$i++) $path_back.="../";
for ($i=count($script_path)-$path_d-1;$i$value) {
$value=str_replace("\"","'",$value);
if ($key!="period" && $key!="path" && $key!="db" && $key!="dirs" && $key!="filename" && $value!='')
$result.="\$_POST['".$key."']=\"".$value."\";\n";
}
// print the current working database (but always only once)
if(isset($_SESSION['wss']) && !isset($_POST['mysql_host'])) $result.="\$_POST['mysql_host']=\"".$_SESSION['wss']."\";\n";
// add include(backup.php) to do all the work
$result.="\$period=(3600*24)".$_POST['period'].";\n";
$result.="\$security_key=\"".($PMBP_SYS_VAR['security_key'])."\";\n";
$result.="// This is the relative path to the phpMyBackupPro ".PMBP_VERSION." directory\n";
if ($path_back) $result.="@chdir(\"".$path_back."\");\n";
$result.="@include(\"backup.php\");\n";
$result.="?>";
// show the generated php script
printf(PMBP_EXS_INCL,$_POST['path']."???.php");
echo ":\n \n
";
echo "";
echo "\n <- ".EXS_BACK."\n";
// update specific settings for scheduled backups
if ($_POST['path']!=$PMBP_SYS_VAR['EXS_scheduled_dir'] OR $_POST['period']!=$PMBP_SYS_VAR['EXS_period']) {
$PMBP_SYS_VAR['EXS_scheduled_dir']=$_POST['path'];
$PMBP_SYS_VAR['EXS_period']=$_POST['period'];
}
// save PMBP_SYS_VARS
PMBP_save_export_settings();
// print instructions and export form
} else {
if (isset($selection_ok) && isset($_POST['period'])) echo "