mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-05-01 00:35:39 +00:00
Save to windows path
This commit is contained in:
parent
d5817446ff
commit
daf501785e
@ -36,10 +36,30 @@ if (!empty($_POST)) {
|
|||||||
$path = str_replace("\\", "\\\\", $path);
|
$path = str_replace("\\", "\\\\", $path);
|
||||||
$path .= '\\\\data\\\\global\\\\excel\\\\';
|
$path .= '\\\\data\\\\global\\\\excel\\\\';
|
||||||
|
|
||||||
$conf[$modname]['path'] = $path;
|
PDO_Connect("sqlite:../d2im.db");
|
||||||
$conf[$modname]['modname'] = $modname;
|
$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 {
|
} else {
|
||||||
PDO_Connect("sqlite:../d2im.db");
|
PDO_Connect("sqlite:../d2im.db");
|
||||||
|
|
||||||
@ -70,8 +90,6 @@ ERROR: INVALID PATH</h1></center>';
|
|||||||
header("Location: /processFiles.php");
|
header("Location: /processFiles.php");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user