Edit File by line
/home/barbar84/public_h.../extracte.../filemang...
File: import.php
<?php
[0] Fix | Delete
[1] Fix | Delete
const ACCESS = true;
[2] Fix | Delete
[3] Fix | Delete
include_once 'function.php';
[4] Fix | Delete
[5] Fix | Delete
[6] Fix | Delete
[7] Fix | Delete
$title = 'Upload files';
[8] Fix | Delete
[9] Fix | Delete
include_once 'header.php';
[10] Fix | Delete
[11] Fix | Delete
echo '<div class="title">' . $title . '</div>';
[12] Fix | Delete
[13] Fix | Delete
if ($dir == null || !is_dir(processDirectory($dir))) {
[14] Fix | Delete
echo '<div class="list"><span>The path does not exist</span></div>
[15] Fix | Delete
<div class="title">Function</div>
[16] Fix | Delete
<ul class="list">
[17] Fix | Delete
<li><img src="icon/list.png"/> <a href="index.php' . $pages['paramater_0'] . '">List</a></li>
[18] Fix | Delete
</ul>';
[19] Fix | Delete
} else {
[20] Fix | Delete
$dir = processDirectory($dir);
[21] Fix | Delete
[22] Fix | Delete
if (isset($_POST['submit'])) {
[23] Fix | Delete
$isEmpty = true;
[24] Fix | Delete
[25] Fix | Delete
foreach ($_POST['url'] as $entry) {
[26] Fix | Delete
if (!empty($entry)) {
[27] Fix | Delete
$isEmpty = false;
[28] Fix | Delete
break;
[29] Fix | Delete
}
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
if ($isEmpty) {
[33] Fix | Delete
echo '<div class="notice_failure">No url has been entered yet</div>';
[34] Fix | Delete
} else {
[35] Fix | Delete
for ($i = 0; $i < count($_POST['url']); ++$i) {
[36] Fix | Delete
if (!empty($_POST['url'][$i])) {
[37] Fix | Delete
$_POST['url'][$i] = processImport($_POST['url'][$i]);
[38] Fix | Delete
[39] Fix | Delete
if (!isURL($_POST['url'][$i]))
[40] Fix | Delete
echo '<div class="notice_failure">URL <strong class="url_import">' . $_POST['url'][$i] . '</strong> illegal</div>';
[41] Fix | Delete
elseif (import($_POST['url'][$i], $dir . '/' . basename($_POST['url'][$i])))
[42] Fix | Delete
echo '<div class="notice_succeed">Import files <strong class="file_name_import">' . basename($_POST['url'][$i]) . '</strong>, <span class="file_size_import">' . size(filesize($dir . '/' . basename($_POST['url'][$i]))) . '</span> successfully</div>';
[43] Fix | Delete
else
[44] Fix | Delete
echo '<div class="notice_failure">Import files <strong class="file_name_import">' . basename($_POST['url'][$i]) . '</strong> failure</div>';
[45] Fix | Delete
}
[46] Fix | Delete
}
[47] Fix | Delete
}
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
echo '<div class="list">
[51] Fix | Delete
<span>' . printPath($dir, true) . '</span><hr/>
[52] Fix | Delete
<form action="import.php?dir=' . $dirEncode . $pages['paramater_1'] . '" method="post">
[53] Fix | Delete
<span class="bull">&bull; </span>URL 1:<br/>
[54] Fix | Delete
<input type="text" name="url[]" size="18"/><br/>
[55] Fix | Delete
<span class="bull">&bull; </span>URL:<br/>
[56] Fix | Delete
<input type="text" name="url[]" size="18"/><br/>
[57] Fix | Delete
<span class="bull">&bull; </span>URL 3:<br/>
[58] Fix | Delete
<input type="text" name="url[]" size="18"/><br/>
[59] Fix | Delete
<span class="bull">&bull; </span>URL 4:<br/>
[60] Fix | Delete
<input type="text" name="url[]" size="18"/><br/>
[61] Fix | Delete
<span class="bull">&bull; </span>URL 5:<br/>
[62] Fix | Delete
<input type="text" name="url[]" size="18"/><br/>
[63] Fix | Delete
<input type="submit" name="submit" value="import"/>
[64] Fix | Delete
</form>
[65] Fix | Delete
</div>
[66] Fix | Delete
[67] Fix | Delete
<div class="tips"><img src="icon/tips.png"/> It s okay to not have http:// in front. If there is https://, you must enter it</div>
[68] Fix | Delete
[69] Fix | Delete
<div class="title">Function</div>
[70] Fix | Delete
<ul class="list">
[71] Fix | Delete
<li><img src="icon/create.png"/> <a href="create.php?dir=' . $dirEncode . $pages['paramater_1'] . '">Create new</a></li>
[72] Fix | Delete
<li><img src="icon/upload.png"/> <a href="upload.php?dir=' . $dirEncode . $pages['paramater_1'] . '">Upload files</a></li>
[73] Fix | Delete
<li><img src="icon/list.png"/> <a href="index.php?dir=' . $dirEncode . $pages['paramater_1'] . '">List</a></li>
[74] Fix | Delete
</ul>';
[75] Fix | Delete
}
[76] Fix | Delete
[77] Fix | Delete
include_once 'footer.php';
[78] Fix | Delete
[79] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function