Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isset($_POST['uploadBtn']) && $_POST['uploadBtn'] == 'Upload') {
- if (isset($_FILES['file']) && $_FILES['file']['error'] === UPLOAD_ERR_OK) {
- $fileTmpPath = $_FILES['file']['tmp_name'];
- $fileName = $_FILES['file']['name'];
- $fileSize = $_FILES['file']['size'];
- $fileType = $_FILES['file']['type'];
- $fileNameCmps = explode(".", $fileName);
- $fileExtension = strtolower(end($fileNameCmps));
- $newFileName = md5(time() . $fileName) . '.' . $fileExtension;
- $allowedfileExtensions = array('jpg', 'gif', 'png', 'zip', 'txt', 'xls', 'doc');
- echo $fileName;
- if (in_array($fileExtension, $allowedfileExtensions)) {
- $uploadFileDir = 'img/';
- $dest_path = $uploadFileDir . $newFileName;
- echo "vamoos";
- if(move_uploaded_file($fileTmpPath, $dest_path)) {
- $message ='File is successfully uploaded.';
- $_SESSION['message'] = $message;
- echo $message;
- }
- else {
- $message = 'There was some error moving the file to upload directory. Please make sure the upload directory is writable by web server.';
- $_SESSION['message'] = $message;
- echo "3";
- }
- }
- }else {echo "algo no funciona1"; }
- }else {echo "algo no funciona"; }
- $selectMeme = $selectPlantilla = "";
- $invisibleMeme = $invisiblePlantilla = "invisible";
- $error = $selected = "";
- if ( isset($_GET['u']) ) {
- if ( $_GET['u'] == "meme" ) {
- $selected = "memes";
- $selectMeme = "checked";
- $invisibleMeme = "";
- $selectPlantilla = "";
- $invisiblePlantilla = "invisible";
- } else {
- $selected = "plantillas";
- $selectPlantilla = "checked";
- $invisiblePlantilla = "";
- $selectMeme = "";
- $invisibleMeme = "invisible";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement