[PHP] Auto Link Maker (For Right Click > Save As)
[PHP] Auto Link Maker (For Right Click > Save As)
Have you ever used mozilla and been to a page where they're showing 'funny videos' 'funny ads' or whatever, and its wmv? I'm able to right click and get the url, but i cant just place that in and get it to dl, it shows text. So theres no way to install the plugin (if someone knows a way tell me) and I can't view WMV.
So here comes my thoughts. I'd have a PHP that I'd go to, paste a link, and it'd give back the same page, but with the link so i could right click and save as. This way I'd be able to view the wmv, without having to edit a freaking html file each time, saving, and opening.
Since this is (at least seemingly) a simple project, and yet I lack the knowledge to do it, I thought someone here could whip some magic php miracles in mere seconds, and post the code.
So here comes my thoughts. I'd have a PHP that I'd go to, paste a link, and it'd give back the same page, but with the link so i could right click and save as. This way I'd be able to view the wmv, without having to edit a freaking html file each time, saving, and opening.
Since this is (at least seemingly) a simple project, and yet I lack the knowledge to do it, I thought someone here could whip some magic php miracles in mere seconds, and post the code.
hahaha i don't come to these forums anymore 
That was a problem in the older versions of firebird and mozilla, when improper mime encoding was sent by the server it would show ascii charaters in the browser instead of downloading the binary info. The latest version, FireFox, doesn't have this problem.
You could also use a download manager such as leechget to capture the link and download it when you click in the browser.
If I interpreted what you are asking wrong I'm sorry. I'm in a rush
You could also use a download manager such as leechget to capture the link and download it when you click in the browser.
If I interpreted what you are asking wrong I'm sorry. I'm in a rush

- Vektor T. Gecko
- Redshirt
- Posts: 859
- Joined: Fri Feb 14, 2003 8:43 am
- Gender: Male
- Location: Ontario
That's not a problem with the browser, that's the browser doing exactly what it's supposed to. The server is saying it's text/plain, then the browser most certainly SHOULD be displaying the file as plain text, and it's something that needs to be fixed on the server, not the browser.
Why not just code the script yourself? All the documentation (and it's quite thorough documentation) for PHP functions is available on php.net
Why not just code the script yourself? All the documentation (and it's quite thorough documentation) for PHP functions is available on php.net
If all else fails, use fire.
[quote="Vektor T. Gecko";p="294355"]That's not a problem with the browser, that's the browser doing exactly what it's supposed to. The server is saying it's text/plain, then the browser most certainly SHOULD be displaying the file as plain text, and it's something that needs to be fixed on the server, not the browser.[/quote]
I half-agree, but then again... It's such a common problem that I fully support the people that want Mozilla to auto-detect MIME types when it receives "text/plain" as the MIME type.
Yeah, the server is mis-configured, but... (This is really IE's fault for always going by the file extension for MIME types. I've forgotten how many times I've had to end URLs to scripts end with ?ie=/a.jpg to make IE accept that the the URL it's accessing really is a JPG.)
BTW, try the View Info dialog. Right click on the page, choose "View Info" and go to the Media tab and find the video in the list of links. There's a "Save As..." button there that saves the image.
Or at least there is in Firefox, I haven't been using Mozilla since 1.5.
I half-agree, but then again... It's such a common problem that I fully support the people that want Mozilla to auto-detect MIME types when it receives "text/plain" as the MIME type.
Yeah, the server is mis-configured, but... (This is really IE's fault for always going by the file extension for MIME types. I've forgotten how many times I've had to end URLs to scripts end with ?ie=/a.jpg to make IE accept that the the URL it's accessing really is a JPG.)
BTW, try the View Info dialog. Right click on the page, choose "View Info" and go to the Media tab and find the video in the list of links. There's a "Save As..." button there that saves the image.
Or at least there is in Firefox, I haven't been using Mozilla since 1.5.
I know about that save as thing, but it doesn't seem to work with embeded wmv's, at least in my history.
However, I've found something 'slightly' related to this.
http://javascript.internet.com/forms/html-preview.html
I just have to figure out how to merge
with
[/code]">Right Click Here</a>[/code]
and let that form submit, return a page, and there we go. Again, I've read through the stuff on php.net, and it's a LOT of stuff, and it's really good, but forms and POST are really difficult to understand, especially the part about returning what was POSTed.
However, I've found something 'slightly' related to this.
http://javascript.internet.com/forms/html-preview.html
I just have to figure out how to merge
Code: Select all
<a href="[/code]">Right Click Here</a>[/code]
and let that form submit, return a page, and there we go. Again, I've read through the stuff on php.net, and it's a LOT of stuff, and it's really good, but forms and POST are really difficult to understand, especially the part about returning what was POSTed.
hahaha i don't come to these forums anymore 
- Vektor T. Gecko
- Redshirt
- Posts: 859
- Joined: Fri Feb 14, 2003 8:43 am
- Gender: Male
- Location: Ontario
Code: Select all
$_POST['name']for something like:
Code: Select all
<FORM ACTION="myscript.php" METHOD="POST">
<INPUT TYPE=whatever NAME="pants">
.
.
.
</FORM>Code: Select all
$_POST['pants']If all else fails, use fire.
So something like
then
I don't know how to $+ $+ in php, and I've not found the way. Actually I think it is $+!
:-/
Code: Select all
<Form ACTION="linker.php" METHOD="POST">
<INPUT TYPE=text NAME="filename">
</Form>Code: Select all
<a href="$_POST['filename']">Rightclickme</a>:-/
hahaha i don't come to these forums anymore 
In order to output variables, you have two choices. Both are okay, but for more advanced outputs, the second one will have less conflicts.
So, for what you want, you can use the following code.
Code: Select all
echo "some plain text, $varname, some more plain text"; // 1st option
echo "some plain text, ".$varname.", some more plain text"; // 2nd option
Code: Select all
<?php
// linker.php
if ($newpage) {
echo "<a href='".$newpage."'>Generated link is here.</a>";
} else {
echo "<form action='linker.php' method='post'>URL: <input type='text' name='newpage'>";
echo "<p><input type='submit' value='Submit'></form>";
}
?>
if ($you == "dumb") { $me = "Slap $you upside the head."; $you = "pissed"; }
if ($you == "pissed") { $me = "Laugh and laugh at $you."; $you = "Slap $me upside the head."; $me_chicken = "yes"; }
if ($me_chicken == "yes") { return; }
if ($you == "pissed") { $me = "Laugh and laugh at $you."; $you = "Slap $me upside the head."; $me_chicken = "yes"; }
if ($me_chicken == "yes") { return; }
To make it display the submit button again, just remove the else part of the if...then...else statment, like so.
Code: Select all
<?php
// linker.php
if ($newpage) {
echo "<a href='".$newpage."'>Generated link is here.</a>";
}
echo "<p><form action='linker.php' method='post'>URL: <input type='text' name='newpage'>";
echo "<p><input type='submit' value='Submit'></form>";
?>
if ($you == "dumb") { $me = "Slap $you upside the head."; $you = "pissed"; }
if ($you == "pissed") { $me = "Laugh and laugh at $you."; $you = "Slap $me upside the head."; $me_chicken = "yes"; }
if ($me_chicken == "yes") { return; }
if ($you == "pissed") { $me = "Laugh and laugh at $you."; $you = "Slap $me upside the head."; $me_chicken = "yes"; }
if ($me_chicken == "yes") { return; }
- Deacon
- Shining Adonis
- Posts: 44234
- Joined: Wed Jul 30, 2003 3:00 pm
- Gender: Male
- Location: Lakehills, TX
[quote="DJ TopCat";p="294483"]I know about that save as thing, but it doesn't seem to work with embeded wmv's, at least in my history.[/quote]
Install and use Firefox.
Visit page with embedded media.
Select "Tools" -> "Page Info" (CTRL+J)
Click on "Media" tab.
Click on the embedded media from the list.
Click "Save As..." button.
Figure the rest out yourself
Install and use Firefox.
Visit page with embedded media.
Select "Tools" -> "Page Info" (CTRL+J)
Click on "Media" tab.
Click on the embedded media from the list.
Click "Save As..." button.
Figure the rest out yourself
The follies which a man regrets the most in his life are those which he didn't commit when he had the opportunity. - Helen Rowland, A Guide to Men, 1922
Who is online
Users browsing this forum: No registered users and 1 guest


