3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Martin Su - Allio Parser (Upload)</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <br> <h1>http://admin-test.pmm/saves/index</h1> <form method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> <?php $target_dir = "files/retailers/id/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); // Check if image file is a actual image or fake image if(isset($_POST["submit"])) { $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); if($check !== false) { echo "File is an image - " . $check["mime"] . "."; $uploadOk = 1; } else { echo "File is not an image."; $uploadOk = 0; } } // Check if file already exists if (file_exists($target_file)) { echo "Sorry, file already exists."; $uploadOk = 0; } // Check file size if ($_FILES["fileToUpload"]["size"] > 1000000) { echo "Sorry, your file is too large."; $uploadOk = 0; } // Allow certain file formats if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" && $imageFileType != "gif" ) { echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "Sorry, your file was not uploaded."; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded."; } else { echo "Sorry, there was an error uploading your file."; } } ?> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>
Output for 8.3.0 - 8.3.4
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Martin Su - Allio Parser (Upload)</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <br> <h1>http://admin-test.pmm/saves/index</h1> <form method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> Warning: Undefined array key "fileToUpload" in /in/44kF9 on line 27 Warning: Trying to access array offset on null in /in/44kF9 on line 27 Deprecated: basename(): Passing null to parameter #1 ($path) of type string is deprecated in /in/44kF9 on line 27 Warning: file_exists(): open_basedir restriction in effect. File(files/retailers/id/) is not within the allowed path(s): (/tmp:/in:/etc) in /in/44kF9 on line 42 Warning: Undefined array key "fileToUpload" in /in/44kF9 on line 47 Warning: Trying to access array offset on null in /in/44kF9 on line 47 Sorry, only JPG, JPEG, PNG & GIF files are allowed.Sorry, your file was not uploaded. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Martin Su - Allio Parser (Upload)</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <br> <h1>http://admin-test.pmm/saves/index</h1> <form method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> Warning: Undefined array key "fileToUpload" in /in/44kF9 on line 27 Warning: Trying to access array offset on value of type null in /in/44kF9 on line 27 Deprecated: basename(): Passing null to parameter #1 ($path) of type string is deprecated in /in/44kF9 on line 27 Warning: file_exists(): open_basedir restriction in effect. File(files/retailers/id/) is not within the allowed path(s): (/tmp:/in:/etc) in /in/44kF9 on line 42 Warning: Undefined array key "fileToUpload" in /in/44kF9 on line 47 Warning: Trying to access array offset on value of type null in /in/44kF9 on line 47 Sorry, only JPG, JPEG, PNG & GIF files are allowed.Sorry, your file was not uploaded. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Martin Su - Allio Parser (Upload)</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <br> <h1>http://admin-test.pmm/saves/index</h1> <form method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> Warning: Undefined array key "fileToUpload" in /in/44kF9 on line 27 Warning: Trying to access array offset on value of type null in /in/44kF9 on line 27 Warning: file_exists(): open_basedir restriction in effect. File(files/retailers/id/) is not within the allowed path(s): (/tmp:/in:/etc) in /in/44kF9 on line 42 Warning: Undefined array key "fileToUpload" in /in/44kF9 on line 47 Warning: Trying to access array offset on value of type null in /in/44kF9 on line 47 Sorry, only JPG, JPEG, PNG & GIF files are allowed.Sorry, your file was not uploaded. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>
Output for 8.0.13
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Martin Su - Allio Parser (Upload)</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <br> <h1>http://admin-test.pmm/saves/index</h1> <form method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> Warning: Undefined array key "fileToUpload" in /in/44kF9 on line 27 Warning: Trying to access array offset on value of type null in /in/44kF9 on line 27 Warning: Undefined array key "fileToUpload" in /in/44kF9 on line 47 Warning: Trying to access array offset on value of type null in /in/44kF9 on line 47 Sorry, only JPG, JPEG, PNG & GIF files are allowed.Sorry, your file was not uploaded. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>
Output for 7.4.33
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Martin Su - Allio Parser (Upload)</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <br> <h1>http://admin-test.pmm/saves/index</h1> <form method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> Notice: Undefined index: fileToUpload in /in/44kF9 on line 27 Notice: Trying to access array offset on value of type null in /in/44kF9 on line 27 Notice: Undefined index: fileToUpload in /in/44kF9 on line 47 Notice: Trying to access array offset on value of type null in /in/44kF9 on line 47 Sorry, only JPG, JPEG, PNG & GIF files are allowed.Sorry, your file was not uploaded. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>
Output for 7.4.0 - 7.4.32
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Martin Su - Allio Parser (Upload)</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <br> <h1>http://admin-test.pmm/saves/index</h1> <form method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> Notice: Undefined index: fileToUpload in /in/44kF9 on line 27 Notice: Trying to access array offset on value of type null in /in/44kF9 on line 27 Warning: file_exists(): open_basedir restriction in effect. File(files/retailers/id/) is not within the allowed path(s): (/tmp:/in:/etc) in /in/44kF9 on line 42 Notice: Undefined index: fileToUpload in /in/44kF9 on line 47 Notice: Trying to access array offset on value of type null in /in/44kF9 on line 47 Sorry, only JPG, JPEG, PNG & GIF files are allowed.Sorry, your file was not uploaded. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>
Output for 7.3.32 - 7.3.33
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Martin Su - Allio Parser (Upload)</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <br> <h1>http://admin-test.pmm/saves/index</h1> <form method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> Sorry, only JPG, JPEG, PNG & GIF files are allowed.Sorry, your file was not uploaded. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>
Output for 7.1.25 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Martin Su - Allio Parser (Upload)</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <br> <h1>http://admin-test.pmm/saves/index</h1> <form method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> Notice: Undefined index: fileToUpload in /in/44kF9 on line 27 Warning: file_exists(): open_basedir restriction in effect. File(files/retailers/id/) is not within the allowed path(s): (/tmp:/in:/etc) in /in/44kF9 on line 42 Notice: Undefined index: fileToUpload in /in/44kF9 on line 47 Sorry, only JPG, JPEG, PNG & GIF files are allowed.Sorry, your file was not uploaded. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>
Output for 7.1.20
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Martin Su - Allio Parser (Upload)</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <br> <h1>http://admin-test.pmm/saves/index</h1> <form method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> Notice: Undefined index: fileToUpload in /in/44kF9 on line 27 Warning: file_exists(): open_basedir restriction in effect. File(files/retailers/id/) is not within the allowed path(s): (/tmp:/in) in /in/44kF9 on line 42 Notice: Undefined index: fileToUpload in /in/44kF9 on line 47 Sorry, only JPG, JPEG, PNG & GIF files are allowed.Sorry, your file was not uploaded. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Martin Su - Allio Parser (Upload)</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <br> <h1>http://admin-test.pmm/saves/index</h1> <form method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> Notice: Undefined index: fileToUpload in /in/44kF9 on line 27 Notice: Undefined index: fileToUpload in /in/44kF9 on line 47 Sorry, only JPG, JPEG, PNG & GIF files are allowed.Sorry, your file was not uploaded. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>

preferences:
192.74 ms | 404 KiB | 212 Q