-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathfolder_new.php
41 lines (36 loc) · 1.1 KB
/
folder_new.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
require_once ("./header.php");
logged_in_only ();
$foldername = set_post_foldername ();
$public = set_post_bool_var ("public", false);
if ($foldername == "") {
?>
<h2 class="title">New Folder</h2>
<form action="<?php echo $_SERVER['SCRIPT_NAME'] . "?folderid=" . $folderid; ?>" id="fnew" method="POST">
<p><input type=text name="foldername" size="50" value="<?php echo $foldername; ?>"></p>
<p><input type="checkbox" name="public"> Public</p>
<input type="submit" value=" OK ">
<input type="button" value=" Cancel " onClick="self.close()">
</form>
<script>
this.focus();
document.getElementById('fnew').foldername.focus();
</script>
<?php
}
else {
$query = sprintf ("INSERT INTO folder (childof, name, public, user) values ('%d', '%s', '%d', '%s')",
$mysql->escape ($folderid),
$mysql->escape ($foldername),
$mysql->escape ($public),
$mysql->escape ($username));
if ($mysql->query ($query)) {
echo "Folder successfully created<br>\n";
echo '<script language="JavaScript">reloadclose();</script>';
}
else {
message ($mysql->error);
}
}
require_once (ABSOLUTE_PATH . "footer.php");
?>