Hej! Med reservation för att det är morgon:Problem, uppladdningsfunktion
Hittade följande kod på nätet. Nu är det så att jag vill att alla uppladdade filer ska hamna i en egen mapp. Vad ska jag ändra på?
<HTML>
<TITLE>File Manager</TITLE>
<?PHP
global $HTTP_GET_VARS;
if(isset($HTTP_GET_VARS['dir']))
$DIRPATH = $HTTP_GET_VARS['dir'];
if(isset($HTTP_GET_VARS['what']))
$WHAT = $HTTP_GET_VARS['what'];
if(isset($HTTP_GET_VARS['save']))
$SAVEIT = $HTTP_GET_VARS['save'];
if(isset($HTTP_GET_VARS['tothis']))
$TOTHIS = $HTTP_GET_VARS['tothis'];
if(isset($HTTP_GET_VARS['dowhat']))
$DOWHAT = $HTTP_GET_VARS['dowhat'];
if(isset($HTTP_GET_VARS['downloads']))
$DOWNLOADS = $HTTP_GET_VARS['downloads'];
if(isset($HTTP_GET_VARS['images']))
$IMAGES = $HTTP_GET_VARS['images'];
if (!$DIRPATH)
$DIRPATH = "./";
if (!$WHAT)
filemanager ($DIRPATH, $SAVEIT, $TOTHIS, $DOWHAT, $DOWNLOADS, $IMAGES);
if ($WHAT == 1)
createhtml ($DIRPATH, $DOWHAT, $SAVEIT);
if ($WHAT == 2)
uploadfile ($DIRPATH, $SAVEIT);
function filemanager ($DIRPATH, $SAVEIT, $TOTHIS, $DOWHAT, $DOWNLOADS, $IMAGES)
{
if ($DIRPATH)
{
if ($DOWHAT == 1)
{
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
$thedir = "$DIRPATH$TOTHIS";
if (unlink ($thedir))
echo "File: $thedir was deleted successfully<br>";
else
echo "File: $thedir could not be deleted. BOooooo.<br>";
}
if ($DOWHAT == 2)
{
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
$thedir = "$DIRPATH$TOTHIS";
$file = fopen ($thedir, "rb");
while (!feof ($file))
$filestring = $filestring . fgets ($file, filesize ($thedir) + 1);
echo "<FORM METHOD = \"POST\" enctype = \"multipart/form-data\" ACTION = \"./filemanager.php?what=0&dowhat=4&tothis=$TOTHIS&downloads=$DOWNLOADS&images=$IMAGES&dir=$DIRPATH\">";
echo "<center><textarea name = \"txtNEWS\" rows = \"20\" cols = \"60\" wrap = \"virtual\">$filestring</textarea><br>";
echo "<input type = \"submit\" name = \"cmdSUBMIT\" value = \"Save\"><br>";
echo "</FORM>";
fclose ($file);
}
if ($DOWHAT == 3)
{
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
$thedir = "$DIRPATH$TOTHIS";
$RENAMETO = stripslashes ($_POST["txtRENAME"]);
if (rename ("$DIRPATH$TOTHIS", "$DIRPATH$RENAMETO"))
echo "File: $DIRPATH/$TOTHIS was renamed to $DIRPATH/$RENAMETO<br>";
else
echo "File: $DIRPATH/$TOTHIS could not be renamed. BOoooo<br>";
}
if ($DOWHAT == 4)
{
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
$thedir = "$DIRPATH$TOTHIS";
$string = stripslashes($_POST["txtNEWS"]);
$file = fopen ("$DIRPATH$TOTHIS", "wb");
fwrite ($file, $string);
fclose ($file);
echo "File successfully saved.<br>";
}
if (!$DOWHAT)
{
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
$dir = opendir ("$DIRPATH");
while ($file = readdir ($dir))
{
$string = $file;
echo "<FORM METHOD = \"POST\" enctype = \"multipart/form-data\" ACTION = \"./filemanager.php?dir=$DIRPATH&what=0&dowhat=3&tothis=$file\">";
if (filetype ("$DIRPATH/$string") == 'dir')
{
echo "Directory: $string<br>";
switch ($string)
{
case ".":
echo " View";
echo "<br>";
echo "<br>";
break;
case "..":
echo " View";
echo "<br>";
echo "<br>";
break;
default:
echo " View";
echo " Delete";
echo " Rename: <input type = \"text\" name = \"txtRENAME\" value = \"$string\">";
echo "<input type = \"submit\" name = \"cmdSUBMIT\" value = \"Rename\"><br><br>";
break;
}
}
}
closedir ($dir);
$dir = opendir ("$DIRPATH");
while ($file = readdir ($dir))
{
$string = $file;
if (!(filetype ("$DIRPATH/$string") == 'dir'))
{
echo "File: $string<br>";
echo " Delete";
echo " Edit";
echo " Rename: <input type = \"text\" name = \"txtRENAME\" value = \"$string\">";
echo "<input type = \"submit\" name = \"cmdSUBMIT\" value = \"Rename\"><br><br>";
}
echo "</FORM>";
}
closedir ($dir);
}
}
}
function createhtml($DIRPATH, $DOWHAT, $SAVEIT)
{
if (!$DOWHAT)
{
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
echo "<FORM METHOD = \"POST\" enctype = \"multipart/form-data\" ACTION = \"./filemanager.php?dir=$DIRPATH&what=1&dowhat=6\">";
echo "Title of your page: <INPUT TYPE = \"text\" NAME = \"txtTITLE\"><br>";
echo "How do you want your page justified?";
echo "<select name = \"lstBANDS\">";
echo "<option>Left Justified</option>";
echo "<option>Centered</option>";
echo "<option>Right Justified</option>";
echo "</select><br>";
echo "<INPUT TYPE = \"submit\" VALUE = \"Submit\" NAME = \"cmdSUBMIT\">";
echo "</FORM>";
}
if ($DOWHAT == 1)
addimage ($DIRPATH);
if ($DOWHAT == 2)
addlink ($DIRPATH);
if ($DOWHAT == 3)
adddownload ($DIRPATH);
if ($DOWHAT == 4)
uploadimage ($DIRPATH);
if ($DOWHAT == 5)
addurl ($DIRPATH);
if ($DOWHAT == 6)
{
if ($TITLE = $_POST["txtTITLE"])
{
$file = fopen ("$DIRPATH" . "temp.txt", "wb");
fwrite ($file, "<HTML>\n");
fwrite ($file, "<TITLE>$TITLE</TITLE>\n");
fwrite ($file, "<body bgcolor = \"#0D3142\" text = \"#FFFFFF\" link = \"#97CBFF\" vlink = \"#C0C0C0\" alink = \"#FFFFFF\">\n");
fwrite ($file, "<center><font size = \"20\">$TITLE</font></center><br><br>\n");
if ($bah = $_POST["lstBANDS"])
{
if ($bah == "Left Justified")
fwrite ($file, "<p align = \"left\">\n");
if ($bah == "Centered")
fwrite ($file, "<center>\n");
if ($bah == "Right Justified")
fwrite ($file, "<p align = \"right\">\n");
}
fclose ($file);
}
mainthingy ($DIRPATH);
}
if ($DOWHAT == 7)
addtext ($DIRPATH);
if ($DOWHAT == 8)
adddownload2 ($DIRPATH);
if ($DOWHAT == 9)
addtext2 ($DIRPATH);
if ($DOWHAT == 10)
{
$file = fopen ("$DIRPATH" . "temp.txt", "rb");
while (!feof($file))
$string = $string . fgets ($file, filesize ("$DIRPATH" . "temp.txt") + 1);
fclose ($file);
$file = fopen ("$DIRPATH" . "temp.txt", "wb");
fwrite ($file, $string);
fwrite ($file, " ");
fclose ($file);
mainthingy ($DIRPATH);
}
if ($DOWHAT == 11)
{
$file = fopen ("$DIRPATH" . "temp.txt", "rb");
while (!feof($file))
$string = $string . fgets ($file, filesize ("$DIRPATH" . "temp.txt") + 1);
fclose ($file);
$file = fopen ("$DIRPATH" . "temp.txt", "wb");
fwrite ($file, $string);
fwrite ($file, "<br>");
fclose ($file);
mainthingy ($DIRPATH);
}
if ($DOWHAT == 12)
{
}
if ($SAVEIT == 1)
SAVEFILE ($DIRPATH);
if ($SAVEIT == 2)
SAVEFILE2 ($DIRPATH);
}
function mainthingy ($DIRPATH)
{
$file = fopen ("$DIRPATH" . "temp.txt", "rb");
while (!feof($file))
$string = $string . fgets ($file, filesize ("$DIRPATH" . "temp.txt") + 1);
fclose ($file);
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
echo "<FORM METHOD = \"POST\" enctype = \"multipart/form-data\" ACTION = \"./filemanager.php?who=$DIRPATH&what=1&save=1&dowhat=12\">";
echo "<center>";
echo "Add Text ";
echo "Add Image ";
echo "Add Link ";
echo "Add Download ";
echo "Add a space ";
echo "Add another line";
echo "<br>";
echo "HTML:<br><textarea name = \"txtNEWS\" rows = \"20\" cols = \"60\" wrap = \"virtual\">";
echo $string;
echo "</textarea>";
echo "<br>";
echo "<INPUT TYPE = \"submit\" VALUE = \"Submit\" NAME = \"cmdSUBMIT\"></center>";
echo "</FORM>";
}
function addimage ($DIRPATH)
{
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
echo "Click here to upload .gif/.jpg/.jpeg images to your webspace.<br>";
echo "<FORM METHOD = \"POST\" enctype = \"multipart/form-data\" ACTION = \"./filemanager.php?who=$DIRPATH&what=1&dowhat=4\">";
echo "<INPUT TYPE = \"file\" VALUE = \"Browse\" NAME = \"cmdBROWSEIMAGES\"><br>";
echo "Go on to the next line: <input type = \"checkbox\" checked = \"checked\" name = \"chkNEXTLINE\"><br>";
echo "Use this image as a link: <input type = \"checkbox\" name = \"chkLINK\"><br>";
echo "If use this image as a link is checked in, what web site do you want the image to go to? (DO NOT ADD http://): http://<INPUT TYPE = \"text\" NAME = \"txtURL\"><br>";
echo "Is this link pointing to another page on this site? <input type = \"checkbox\" name = \"chkDB\"><br>";
echo "<INPUT TYPE = \"submit\" VALUE = \"Submit\" NAME = \"cmdSUBMIT\"><br>";
echo "</FORM>";
}
function uploadimage ($DIRPATH)
{
if(isset($HTTP_GET_VARS['who']))
$DIRPATH = $HTTP_GET_VARS['who'];
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
$urlman = $_POST["txtURL"];
$path = $DIRPATH . $_FILES ['cmdBROWSEIMAGES']['name'];
$date = getdate();
if (move_uploaded_file ($_FILES['cmdBROWSEIMAGES']['tmp_name'], $path))
{
echo "File was successfully transferred on ";
echo $date["weekday"] . ", " . $date["month"] . " " . $date["mday"] . ", " . $date["year"] . " at " . $date["hours"] . ":" . $date["minutes"] . ":" . $date["seconds"];
echo "<br>This image was saved under your directory/images<br>";
$file = fopen ("$DIRPATH" . "temp.txt", "rb");
while (!feof($file))
$string = $string . fgets ($file, filesize ("$DIRPATH" . "temp.txt") + 1);
fclose ($file);
$file = fopen ("$DIRPATH" . "temp.txt", "wb");
fwrite ($file, $string);
if ($_POST["chkNEXTLINE"])
{
$stringmoo = "<br><img src = \"./images/" . $_FILES['cmdBROWSEIMAGES']['name'] . "\">\n";
if ($_POST["chkLINK"])
{
if ($_POST["chkDB"])
{
$stringmoo = "<br>\n";
}
else
{
$stringmoo = "<br>\n";
}
}
}
else
{
$stringmoo = "<img src = \"./images/" . $_FILES['cmdBROWSEIMAGES']['name'] . "\">\n";
if ($_POST["chkLINK"])
{
if ($_POST["chkDB"])
{
$stringmoo = "\n";
}
else
{
$stringmoo = "\n";
}
}
}
fwrite ($file, $stringmoo);
fclose ($file);
echo "<FORM METHOD = \"POST\" enctype = \"multipart/form-data\" ACTION = \"./filemanager.php?who=$DIRPATH&what=1&dowhat=6\">";
echo "<INPUT TYPE = \"submit\" VALUE = \"Back to your HTML page\" NAME = \"cmdSUBMIT\">";
echo "</FORM>";
}
else
{
echo "File couldn't be transferred.<br><u>This is being logged as an attack on the server.</u><br>Contact Someone13 if this is in error, or else your IP will be traced.<br>Depending on what happened you may be reported to your ISP.<br>";
$file = fopen ("./holyshit.txt", "a");
fwrite ($file, "On " . $date["weekday"] . ", " . $date["month"] . " " . $date["mday"] . ", " . $date["year"] . " at " . $date["hours"] . ":" . $date["minutes"] . ":" . $date["seconds"] . ":" . "\n");
fwrite ($file, "-------------------------------------\n");
fwrite ($file, "Transferred failed.\nThis may be a hacking attempt.\n");
fwrite ($file, $_FILES . "\n\n");
fclose ($file);
print_r ($_FILES);
}
}
function addlink ($DIRPATH)
{
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
echo "<FORM METHOD = \"POST\" enctype = \"multipart/form-data\" ACTION = \"./filemanager.php?who=$DIRPATH&what=1&dowhat=5\">";
echo "Web site (Without the http://): http://<INPUT TYPE = \"text\" NAME = \"txtURL\"><br>";
echo "What the link says: <INPUT TYPE = \"text\" NAME = \"txtSAYS\"><br>";
echo "Go on to the next line: <input type = \"checkbox\" checked = \"checked\"name = \"chkNEXTLINE\"><br>";
echo "Is this link pointing to another page on this site?: <input type = \"checkbox\" name = \"chkDB\"><br>";
echo "Thats all you have to type. You really dont even the http:// part<br>";
echo "<INPUT TYPE = \"submit\" VALUE = \"Submit\" NAME = \"cmdSUBMIT\">";
echo "</FORM>";
}
function addurl ($DIRPATH)
{
$urlman = stripslashes ($_POST["txtURL"]);
$urlsays = stripslashes ($_POST["txtSAYS"]);
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
if ($urlsays == "")
$urlsays = $urlman;
$file = fopen ("$DIRPATH" . "temp.txt", "rb");
while (!feof($file))
$string = $string . fgets ($file, filesize ("$DIRPATH" . "temp.txt") + 1);
fclose ($file);
$file = fopen ("$DIRPATH" . "temp.txt", "wb");
fwrite ($file, $string);
if ($_POST["chkNEXTLINE"])
{
$stringmoo = "<br>$urlsays\n";
if ($_POST["chkDB"])
{
$stringmoo = "<br>$urlsays\n";
}
}
else
{
$stringmoo = "$urlsays\n";
if ($_POST["chkDB"])
{
$stringmoo = "$urlsays\n";
}
}
fwrite ($file, $stringmoo);
fclose ($file);
echo "Link added.";
echo "<FORM METHOD = \"POST\" enctype = \"multipart/form-data\" ACTION = \"./filemanager.php?who=$DIRPATH&what=1&dowhat=6\">";
echo "<INPUT TYPE = \"submit\" VALUE = \"Back to your HTML page\" NAME = \"cmdSUBMIT\">";
echo "</FORM>";
}
function adddownload ($DIRPATH)
{
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
echo "Click here to upload .exe/.zip/.mp3 files that can be downloaded.";
echo "<FORM ACTION = \"./filemanager.php?dowhat=8&what=1&who=$DIRPATH\" METHOD = \"POST\" ENCTYPE = \"multipart/form-data\">";
echo "<INPUT TYPE = \"file\" VALUE = \"Browse\" NAME = \"cmdBROWSEDOWNLOADS\"><br>";
echo "Go on to the next line: <input type = \"checkbox\" checked = \"checked\"name = \"chkNEXTLINE\"><br>";
echo "File Name/Name of song: <input type = \"text\" name = \"txtFILENAME\"><br>";
echo "Description of the file:<br>";
echo "<textarea name = \"txtNEWS\" rows = \"20\" cols = \"60\" wrap = \"virtual\">Description of file goes here</textarea><br>";
echo "<INPUT TYPE = \"submit\" VALUE = \"Submit\" NAME = \"cmdSUBMIT\"><br>";
echo "</FORM>";
}
function adddownload2 ($DIRPATH)
{
error_reporting (0);
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
$filename = stripslashes ($_POST["txtFILENAME"]);
$description = stripslashes ($_POST["txtNEWS"]);
$path = $DIRPATH . $_FILES ["cmdBROWSEDOWNLOADS"]["name"];
$date = getdate();
if (move_uploaded_file ($_FILES["cmdBROWSEDOWNLOADS"]["tmp_name"], $path))
{
if ($file2 = fopen ("../downloads/" . $_FILES["cmdBROWSEDOWNLOADS"]["name"] . ".php", "rb"))
{
while (!feof ($file2))
$descriptions = $descriptions . fgets ($file, filesize ("../downloads/" . $_FILES["cmdBROWSEDOWNLOADS"]["name"] . ".php") + 1);
}
fclose ($file2);
$file = fopen ("../downloads/$DIRPATH/" . $_FILES["cmdBROWSEDOWNLOADS"]["name"] . ".php", "wb");
fwrite ($file, "<?PHP\n");
fwrite ($file, " \$filename=\"" . $filename . "\";\n");
fwrite ($file, " \$description=\"" . $description . $descriptions . "\";\n");
fwrite ($file, "?>");
fclose ($file);
$file = fopen ("$DIRPATH" . "temp.txt", "rb");
while (!feof($file))
$string = $string . fgets ($file, filesize ("$DIRPATH" . "temp.txt") + 1);
fclose ($file);
$file = fopen ("$DIRPATH" . "temp.txt", "wb");
fwrite ($file, $string);
if ($_POST["chkNEXTLINE"])
fwrite ($file, "<br>$filename\n");
else
fwrite ($file, "$filename\n");
fclose ($file);
echo "File was successfully transferred on ";
echo $date["weekday"] . ", " . $date["month"] . " " . $date["mday"] . ", " . $date["year"] . " at " . $date["hours"] . ":" . $date["minutes"] . ":" . $date["seconds"];
echo "<br>This file was saved under your directory under downloads.<br>";
echo "<FORM METHOD = \"POST\" enctype = \"multipart/form-data\" ACTION = \"./filemanager.php?who=$DIRPATH&what=1&dowhat=6\">";
echo "<INPUT TYPE = \"submit\" VALUE = \"Back to your HTML page\" NAME = \"cmdSUBMIT\">";
echo "</FORM>";
}
else
{
echo "File couldn't be transferred.<br><u>This is being logged as an attack on the server.</u><br>Contact Someone13 if this is in error, or else your IP will be traced.<br>Depending on what happened you may be reported to your ISP.<br>";
$file = fopen ("./holyshit.txt", "a");
fwrite ($file, "On " . $date["weekday"] . ", " . $date["month"] . " " . $date["mday"] . ", " . $date["year"] . " at " . $date["hours"] . ":" . $date["minutes"] . ":" . $date["seconds"] . ":" . "\n");
fwrite ($file, "-------------------------------------\n");
fwrite ($file, "Transferred failed.\nThis may be a hacking attempt.\n");
fwrite ($file, $_FILES . "\n\n");
fclose ($file);
print_r ($_FILES);
}
}
function addtext ($DIRPATH)
{
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
echo "<FORM METHOD = \"POST\" enctype = \"multipart/form-data\" ACTION = \"./filemanager.php?who=$DIRPATH&what=1&dowhat=9\">";
echo "Go on to the next line: <input type = \"checkbox\" checked = \"checked\"name = \"chkNEXTLINE\"><br>";
echo "Text:<br><textarea name = \"txtNEWS\" rows = \"20\" cols = \"60\" wrap = \"virtual\">";
echo "</textarea>";
echo "<br>";
echo "<INPUT TYPE = \"submit\" VALUE = \"Submit\" NAME = \"cmdSUBMIT\"></center>";
echo "</FORM>";
}
function addtext2 ($DIRPATH)
{
$string2 = stripslashes ($_POST["txtNEWS"]);
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
if ($string2 == "")
echo "You must enter something before going on.<br>";
else
{
$file = fopen ("$DIRPATH" . "temp.txt", "rb");
while (!feof($file))
$string = $string . fgets ($file, filesize ("$DIRPATH" . "temp.txt") + 1);
fclose ($file);
$file = fopen ("$DIRPATH" . "temp.txt", "wb");
fwrite ($file, $string);
if ($_POST["chkNEXTLINE"])
fwrite ($file, "<br>$string2\n");
else
fwrite ($file, "$string2\n");
fclose ($file);
echo "Text added.";
echo "<FORM METHOD = \"POST\" enctype = \"multipart/form-data\" ACTION = \"./filemanager.php?who=$DIRPATH&what=1&dowhat=6\">";
echo "<INPUT TYPE = \"submit\" VALUE = \"Back to your HTML page\" NAME = \"cmdSUBMIT\">";
echo "</FORM>";
}
}
function SAVEFILE ($DIRPATH)
{
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
echo "<FORM METHOD = \"POST\" enctype = \"multipart/form-data\" ACTION = \"./filemanager.php?who=$DIRPATH&what=1&save=2&dowhat=12\">";
echo "Save file as: <input type = \"text\" name = \"txtNAME\"> ";
echo "<INPUT TYPE = \"submit\" VALUE = \"Save\" NAME = \"cmdSUBMIT\"><br>";
echo "DO NOT ADD A FILE EXTENSION SUCH AS .HTML, .HTM, OR ANYTHING ELSE.<br>";
echo "Preview File";
echo "</FORM>";
}
function SAVEFILE2 ($DIRPATH)
{
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
if ($_POST["txtNAME"])
{
$file = fopen ("$DIRPATH" . "temp.txt", "rb");
while (!feof($file))
$string = $string . fgets ($file, filesize ("$DIRPATH" . "temp.txt") + 1);
fclose ($file);
$file = fopen ("../$DIRPATH/" . $_POST["txtNAME"] . ".htm", "wb");
fwrite ($file, $string);
fwrite ($file, "<p align = \"left\">Back\n");
fwrite ($file, "</HTML>");
fclose ($file);
echo "File was successfully saved under $DIRPATH" . $_POST["txtNAME"] . ".htm<br>";
echo "<br>Have fun clicking the back button until you get back to the main menu!";
}
else
echo "You must enter a filename.<br><br>Use the browser's back button to go back.";
}
function uploadfile($DIRPATH, $SAVEIT)
{
if (!$SAVEIT)
{
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
echo "Click here to upload a file to: $DIRPATH";
echo "<FORM METHOD = \"POST\" enctype = \"multipart/form-data\" ACTION = \"./filemanager.php?what=2&save=1&dir=$DIRPATH\">";
echo "<INPUT TYPE = \"file\" VALUE = \"Browse\" NAME = \"cmdBROWSEHTMS\"> <INPUT TYPE = \"submit\" VALUE = \"Submit\" NAME = \"cmdSUBMIT\"><br>";
echo "</FORM>";
}
if ($SAVEIT == 1)
{
echo "<center>Create a HTML file online Upload a file View your webspace</center>";
$path = $DIRPATH . $_FILES ['cmdBROWSEHTMS']['name'];
$date = getdate();
if (move_uploaded_file ($_FILES['cmdBROWSEHTMS']['tmp_name'], $path))
{
echo "File was successfully transferred on ";
echo $date["weekday"] . ", " . $date["month"] . " " . $date["mday"] . ", " . $date["year"] . " at " . $date["hours"] . ":" . $date["minutes"] . ":" . $date["seconds"];
echo "<br>This file was saved under $DIRPATH.<br>";
}
else
{
echo "File couldn't be transferred.<br><u>This is being logged as an attack on the server.</u><br>Contact Someone13 if this is in error, or else your IP will be traced.<br>Depending on what happened you may be reported to your ISP.<br>";
$file = fopen ("./errors.txt", "a");
fwrite ($file, "On " . $date["weekday"] . ", " . $date["month"] . " " . $date["mday"] . ", " . $date["year"] . " at " . $date["hours"] . ":" . $date["minutes"] . ":" . $date["seconds"] . ":" . "\n");
fwrite ($file, "-------------------------------------\n");
fwrite ($file, "Transferred failed.\nThis may be a hacking attempt.\n");
fwrite ($file, $_FILES . "\n\n");
fclose ($file);
print_r ($_FILES);
}
}
}
?>
</HTML>
hehe, blev en del ;)Sv: Problem, uppladdningsfunktion
Raden: $path = $DIRPATH . $_FILES ['cmdBROWSEHTMS']['name'];
Lägg till ditt katalognamn emellan $DIRPATH och $FILES