Save As PHP Script

Reference on Tuesday, September 16th, 2008

Having a link to a media file that would normally play in a browser allows you to “Save Page As” in Firefox to save the media. (Music, Video, etc.) A minor annoyance is that sometimes the video or the audio starts to play immediately making you press pause while you wait for it to download.

The script below contains a text field where you enter the url of anything you want so you can right click a generated link to download the material. It requires an extension in the url provided. Something like http://audio.hiphopdx.com/20080909-Tony_Sunshine-Here_I_Am_(Feat_Jadakiss)-HHDX.mp3

1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
if ($_POST["url"]) {
echo<a href=’”.$_POST["url"].”‘>Right Click and Save As</a>;
}
?>
<form method=”post” action=”saveas.php”>
<p>
<input type=”text” name=”url” />
</p>
<p>
<input type=”submit” />
</p>
</form>



Share This


Leave a Reply