/* Easy Uploader */
// set variables (SET THESE TO SUIT YOUR CIRCUMSTANCES):
// Upload directory (MUST HAVE TRAILING SLASH):
$uploaddir="./css/public/";
// Your email
$youremail="you@your-domain.co.uk";
// Thank you page:
// Set Upload thanks message for USER
$ucptymessage="$realname, thank you for uploading the file $file_name\n\nWe will get back to you ASAP.";
// Set Upload thanks message for OWNER
$ownermessage="$realname [ $email ] has uploaded a file named $file_name\n\nCheck the upload directory.";
// Email message on or off ? 1 = on, 0 = off
$emailmessages = "0";
// 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 "
";
}
else {
// Check to see if valid file
if ($file == "none") {
// if no valid email address entered, display no file message
echo "";
}
else {
//directory to upload to
//copy($file, $uploaddir.$file_name);unlink($file);
//system("cp -a /var/www/html/ss/public/$file_name /var/www/html/ss/public/$file_name.temp");
//system("chmod 777 /var/www/html/ss/public/$file_name.temp");
//system("pdftops /var/www/html/ss/public/$file_name.temp");
//system("chmod 777 /var/www/html/ss/public/$file_name.temp");
//system("mv /var/www/html/ss/public/$file_name.temp /var/www/html/ss/public/$file_name.ps");
//$thankspage="http://gw.na.infn.it/ss/thanks.php?file=$file_name.ps";
//return thank you page
//Header("Location: $thankspage");
$handle = fopen("/var/www/html/ss/public/listautenti", 'a');
fwrite($handle, $realname);
fclose($handle);
}
}
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;
}
?>