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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.