Save to windows path

This commit is contained in:
color.diff=auto 2021-03-26 12:38:24 -06:00
parent d5817446ff
commit daf501785e

View File

@ -36,10 +36,30 @@ if (!empty($_POST)) {
$path = str_replace("\\", "\\\\", $path);
$path .= '\\\\data\\\\global\\\\excel\\\\';
$conf[$modname]['path'] = $path;
$conf[$modname]['modname'] = $modname;
PDO_Connect("sqlite:../d2im.db");
$sql = "CREATE TABLE IF NOT EXISTS d2im (
modname VARCHAR(255),
path VARCHAR(255)
)";
PDO_Execute($sql);
file_put_contents("../d2im.db", serialize($conf));
$sql = '';
if (!is_dir($path)) {
echo '<center><h1 style="font-family:Lato; color:#880000;"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
ERROR: INVALID PATH</h1></center>';
} else {
$_SESSION['path'] = $path;
// Don't yell at me, security is the least of my considerations atm
// check modname in db
$sql = "SELECT * FROM d2im WHERE modname='$modname'";
$res = PDO_FetchAll($sql);
if (empty($res)) {
$sql = "INSERT INTO d2im(modname,path) VALUES(\"$modname\",\"$path\")";
PDO_Execute($sql);
}
header("Location: /processFiles.php");
}
} else {
PDO_Connect("sqlite:../d2im.db");
@ -70,8 +90,6 @@ ERROR: INVALID PATH</h1></center>';
header("Location: /processFiles.php");
}
}
}
?>
<!doctype html>