'; // Browse button echo ''; echo '
'; echo ''; echo ''; echo '
'; echo ''; // Upload button echo ''; echo '
'; echo ''; echo ''; echo '
'; echo ''; echo ''; echo '
'; if(isset($_FILES['photo'])) { $_FILES['photo']['name'] = preg_replace('/[^a-zA-Z0-9\.]/', '_', $_FILES['photo']['name']); // Check auth here if(isset($_POST['key']) && password_verify($CONFIG['thissitekey'].$_POST['username'], $_POST['key'])) { if(check_bbs_auth($_POST['username'], $_POST['password'])) { $userdir = $spooldir.'/upload/'.strtolower($_POST['username']); $upload_to = $userdir.'/'.$_FILES['photo']['name']; if(is_file($upload_to)) { echo $_FILES['photo']['name'].' already exists in your folder'; } else { if(!is_dir($userdir)) { mkdir($userdir); } $success = move_uploaded_file($_FILES['photo']['tmp_name'], $upload_to); if ($success) { file_put_contents($logfile, "\n".format_log_date()." Saved: ".strtolower($_POST['username'])."/".$_FILES['photo']['name'], FILE_APPEND); echo 'Saved '.$_FILES['photo']['name'].' to your files folder'; } else { echo 'There was an error saving '.$_FILES['photo']['name']; } } ?>
'; } } echo ''; echo ''; if(!isset($_POST['username'])) { $_POST['username'] = ''; } if(!isset($_POST['password'])) { $_POST['password'] = ''; } if(!check_bbs_auth($_POST['username'], $_POST['password'])) { echo ''; echo ''; echo ''; echo ''; echo ''; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ' '; echo ''; } echo ''; echo ''; echo '
Please Login to Upload
Username:
Password:
Logged in as '.$_POST['username'].'
(max size=2MB)
 
'; echo ''; ?>