Jump to content

Save Link As... HELP!


eugene2009

Recommended Posts

Here is part of my code...

<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
error_reporting(E_ALL ^ E_NOTICE);
error_reporting(E_ALL);

// Report all PHP errors
error_reporting(-1);

if(isset($_POST['submit'])) {

$imgurl = $_POST['imgurl'];
$filename = $_POST['filename'];
$filetype = $_POST['filetype'];
$title = $_POST['title'];
$fullurl = "<title>$title</title><img src=\"$imgurl\">";

$myFile = "$filename$filetype";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "$fullurl";
fwrite($fh, $stringData);
fclose($fh);

echo $fullurl
?>
<br><br>
<textarea cols="50" rows="10"><title><?php echo $title ?></title><img src="<?php echo $imgurl ?>"></textarea><br>
Right Click <a href='./<?php echo "$filename$filetype"; ?>'>Here</a> and Click "Save as".

<?php
} else {
?>

 

How can I make a button that says "DOWNLOAD" or something? Which will automatically execute that saving window. Thanks ahead of time.

Link to comment
https://forums.phpfreaks.com/topic/177294-save-link-as-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.