Post: [PHP] Generating a download link
10-27-2013, 07:35 PM #1
Dan
I'm a god.
(adsbygoogle = window.adsbygoogle || []).push({}); I did recieve a little help on this one so I can't take full credit, but it took me a bit to get this to work. Decided to just release it.
You don't have to edit any of the code just paste it in your editor and as .php. Enjoy.

NOTE: I do not recommend putting this where anyone can access it as it is vulnerable!

    
<?php
if(isset($_GET['sub'])) {
if(empty($_GET['link'])) {
echo '<script>alert("Please fill in the field!");</script>';
} else {
$link = htmlspecialchars($_GET['link']);
echo '<form method="POST"><button type="submit" name="dl_link">Awesome faceownload File</button></form>';
if(isset($_POST['dl_link'])) {
header("Content-disposition: attachment; filename=".$link."");
header("Content-type: ".$link.".*:");
readfile("".$link."");
}
}
}
?>
<html>
<body>
<form method="GET">
<input type="text" name="link" placeholder="Paste link here">
<input type="submit" name="sub" value="Get Link">
</form>
</body>
</html>
Last edited by Dan ; 10-28-2013 at 07:47 PM.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo