è possibile che utenti del sito mi facciano upload
utilizzo questo script
questa è la parte nel sito
<form action="upload.php" method="post" ENCTYPE="multipart/form-data">
File to upload:<input type="file" size=40 name="file"><br>
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
Your Name<input type="text" name="realname"><br>
Your Email<input type="text" name="email"><br>
<input type="submit" value="upload">
</form>
questa è la parte in php<?
/* Easy Uploader */
// set variables (SET THESE TO SUIT YOUR CIRCUMSTANCES):
// Upload directory (MUST HAVE TRAILING SLASH):
$uploaddir="/Upload";
// Your email
$youremail="XXX@altervista.org";
// Thank you page:
$thankspage="http://rndivision.altervista.org/thanks.htm";
// Set Upload thanks message for USER
$uptymessage="$realname, Grazie di aver uppato il file $file_name\n\n Torna presto a trovarci.";
// Set Upload thanks message for OWNER
$ownermessage="$realname [ $email ] hanno uppato $file_name\n\nCheck nella tua directory.";
// Email message on or off ? 1 = on, 0 = off
$emailmessages = "1";
// start code (DO NOT CHANGE ANYTHING BELOW THIS LINE):
// Check for valid email address
$x = ereg("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$",$email);
if($x==0)
// if no valid email address entered, display no email message
{
echo "<div align=center>You <b>must</b> specify a valid email address for yourself. <a href=javascript:history.back(-1)>Return to the form</a>.</div>";
}
else {
// Check to see if valid file
if ($file == "none") {
// if no valid email address entered, display no file message
echo "<div align=center>You <b>must</b> specify a file to upload. <a href=javascript:history.back(-1)>Return to the form</a>.</div>";
}
else {
//directory to upload to
copy($file, $uploaddir.$file_name);
unlink($file);
//return thank you page
Header("Location: $thankspage");
}
}
if ($emailmessages == "1") {
//mail you to let you know a new uploaded file
mail("$youremail", "Uploaded file", "$ownermessage");
//mail user to thank them
mail("$email", "Uploaded file", "$uptymessage");
exit;
}
?>
vorrei permettere ai miei utenti di inserire piccoli file sul mio sito....
sembra che tutto fili liscio ma il file non compare nella cartella upload....
COME FACCIO per favore