Jeg bruger selv ftp program, men det er til en person, jeg er ved at lave en hjemmeside til og personen kan ikk finde ud af ftp.
Så derfor synes jeg dette var en genial ting.
Siden ser sådan her ud:
<HTML>
<HEAD>
<TITLE>Uploader v1.0 - Powered by PHPScriptCENTER.com</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<?php
require("setup.php3");
if($doupload) {
if($ADMIN[RequirePass] == "Yes") {
if($password != "$ADMIN[Password]") {
echo("<P><CENTER><B><FONT FACE=\\"Verdana\\">Error</FONT></B></CENTER></P>
<P><CENTER><TABLE WIDTH=\\"450\\" BORDER=\\"0\\" CELLSPACING=\\"0\\"
CELLPADDING=\\"0\\">
<TR>
<TD WIDTH=\\"100%\\" BGCOLOR=\\"#000000\\">
<TABLE WIDTH=\\"450\\" BORDER=\\"0\\" CELLSPACING=\\"1\\" CELLPADDING=\\"2\\">
<TR>
<TD COLSPAN=\\"2\\" BGCOLOR=\\"#ffffff\\">
<FONT COLOR=\\"#000000\\" SIZE=\\"-1\\" FACE=\\"Verdana\\">Invalid Password</FONT></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER><FONT SIZE=\\"-2\\" FACE=\\"Verdana\\"><A HREF=\\"http://www.phpscriptcenter.com/uploader.php3\\" TARGET=\\"_blank\\">Uploader</A> Version 1.0 <BR>
Copyright © 2000-2001 <A HREF=\\"http://www.phpscriptcenter.com/\\" TARGET=\\"_blank\\">PHPScriptCENTER.com</A></FONT></CENTER>
</BODY>
</HTML>");
exit();
}
}
$num = 0;
while($num < $ADMIN[UploadNum]) {
$num++;
$picture = "fileup$num"."_name";
$picture1 = $$picture;
$picture2 = "fileup$num";
$picture3 = $$picture2;
if($picture3 != "none") {
$filesizebtyes = filesize($picture3);
$ok = 1;
if($filesizebtyes < 10) {
$error .= "Error uploading (file size lower than 10 bytes) for file $num<BR>";
$ok = 2;
}
if(file_exists("$ADMIN[directory]/$picture1") OR $ok == 2) {
$error .="File name already exists for file $num<BR>";
} else {
copy ($picture3, "$ADMIN[directory]/$picture1");
$error .="File $num has been uploaded<BR>";
}
}
}
if(!$error) {
$error .= "No files have been selected for upload";
}
echo("<P><CENTER><B><FONT FACE=\\"Verdana\\">Status</FONT></B></CENTER></P>
<P><CENTER><TABLE WIDTH=\\"450\\" BORDER=\\"0\\" CELLSPACING=\\"0\\"
CELLPADDING=\\"0\\">
<TR>
<TD WIDTH=\\"100%\\" BGCOLOR=\\"#000000\\">
<TABLE WIDTH=\\"450\\" BORDER=\\"0\\" CELLSPACING=\\"1\\" CELLPADDING=\\"2\\">
<TR>
<TD COLSPAN=\\"2\\" BGCOLOR=\\"#ffffff\\">
<FONT COLOR=\\"#000000\\" SIZE=\\"-1\\" FACE=\\"Verdana\\">$error</FONT></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER><FONT SIZE=\\"-2\\" FACE=\\"Verdana\\"><A HREF=\\"http://www.phpscriptcenter.com/uploader.php3\\" TARGET=\\"_blank\\">Uploader</A> Version 1.0 <BR>
Copyright © 2000-2001 <A HREF=\\"http://www.phpscriptcenter.com/\\" TARGET=\\"_blank\\">PHPScriptCENTER.com</A></FONT></CENTER>
</BODY>
</HTML>");
exit();
} else {
$num = 0;
while($num < $ADMIN[UploadNum]) {
$num++;
$html .= "<TR>
<TD WIDTH=\\"25%\\" BGCOLOR=\\"#295e85\\">
<FONT COLOR=\\"#ffffff\\" SIZE=\\"-1\\" FACE=\\"Verdana\\">File $num:</FONT></TD>
<TD WIDTH=\\"75%\\" BGCOLOR=\\"#ffffff\\">
<INPUT NAME=\\"fileup$num\\" TYPE=\\"file\\" SIZE=\\"25\\">
</TD> ";
}
if($ADMIN[RequirePass] == "Yes") {
$passhtml = "<P><CENTER><TABLE BORDER=\\"0\\" CELLSPACING=\\"0\\" CELLPADDING=\\"0\\">
<TR>
<TD WIDTH=\\"100%\\" BGCOLOR=\\"#000000\\">
<TABLE WIDTH=\\"300\\" BORDER=\\"0\\" CELLSPACING=\\"1\\" CELLPADDING=\\"2\\">
<TR>
<TD WIDTH=\\"33%\\" BGCOLOR=\\"#295e85\\">
<B><FONT COLOR=\\"#ffffff\\" SIZE=\\"-1\\" FACE=\\"Verdana\\">Password:</FONT></B></TD>
<TD WIDTH=\\"67%\\" BGCOLOR=\\"#ffffff\\">
<INPUT NAME=\\"password\\" TYPE=\\"password\\" SIZE=\\"25\\">
</TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER></P>";
}
echo("<FORM ENCTYPE=\\"multipart/form-data\\" ACTION=\\"uploader.php\\" METHOD=\\"POST\\">
<P><CENTER><B><FONT FACE=\\"Verdana\\">Upload</FONT></B></CENTER></P>
<P><CENTER><TABLE WIDTH=\\"450\\" BORDER=\\"0\\" CELLSPACING=\\"0\\" CELLPADDING=\\"0\\">
<TR>
<TD WIDTH=\\"100%\\" BGCOLOR=\\"#000000\\">
<TABLE WIDTH=\\"450\\" BORDER=\\"0\\" CELLSPACING=\\"1\\" CELLPADDING=\\"2\\">
<TR>
<TD COLSPAN=\\"2\\" BGCOLOR=\\"#295e85\\">
<B><FONT COLOR=\\"#ffffff\\" SIZE=\\"-1\\" FACE=\\"Verdana\\">Select Files</FONT></B></TD>
</TR>$html
</TABLE></TD>
</TR>
</TABLE></CENTER></P>$passhtml<P><CENTER><INPUT NAME=\\"doupload\\" TYPE=\\"submit\\" VALUE=\\"Upload Files\\"></CENTER></FORM>
<P><CENTER> </CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER><FONT SIZE=\\"-2\\" FACE=\\"Verdana\\"><A HREF=\\"http://www.phpscriptcenter.com/uploader.php3\\" TARGET=\\"_blank\\">Uploader</A> Version 1.0 <BR>
Copyright © 2000-2001 <A HREF=\\"http://www.phpscriptcenter.com/\\" TARGET=\\"_blank\\">PHPScriptCENTER.com</A></FONT></CENTER>
</BODY>
</HTML>");
exit();
}
php?>
Og her er den anden side
<?php
$ADMIN[RequirePass] = "Yes"; // Checks to see if upload has a vaild password
$ADMIN[Password] = "password"; // This is the password if the above option is Yes
$ADMIN[UploadNum] = "5"; // Number of upload feilds to put on the html page
$ADMIN[directory] = "uploads"; // The directory the files will be uploaded to (must be chmoded to 777)
php?>