<!-- 
document.writeln('<div style="');
document.writeln('   width: 80px; ');
document.writeln('   height: 105px; ');
document.writeln('   margin-right: 20px; ');
document.writeln('   margin-top: 0px; ');
document.writeln('   margin-left: 0px; ');
document.writeln('   margin-bottom: 10px; ');
document.writeln('   float: left;">');
document.writeln('<a href="http://www.willmaster.com" target="_blank"><img src="http://willmaster.com/images/20000710w80105.jpg" width="80" height="105" border="0" alt="author">');
document.writeln('</a>');
document.writeln('</div>');
document.writeln('');
document.writeln('<h2>');
document.writeln('' + '<' + '!' + '-' + '-' + ' title start ' + '-' + '-' + '>' + '');
document.writeln('One Time Use Download Link');
document.writeln('' + '<' + '!' + '-' + '-' + ' title end ' + '-' + '-' + '>' + '');
document.writeln('</h2>');
document.writeln('');
document.writeln('<p>by <a target="_blank" href="http://www.willmaster.com"><i>Will Bontrager</i></a>');
document.writeln('<br />Copyright 2009 <a target="_blank" href="http://www.willmaster.com">Bontrager Connection, LLC</a>');
document.writeln('</p>');
document.writeln('' + '<' + '!' + '-' + '-' + ' article start ' + '-' + '-' + '>' + '');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('<p>');
document.writeln('When you need to provide a temporary download link that can be used only once, the PHP scr' + 'ipt in this article can provide the means.');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('With the download limited to once, there is no longer need to manually monitor activity in order to remove the download file immediately afterward. Instead, the download file can be removed later at your leisure.');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('Alternatively, the file can be deleted from the server immediately after downloading, instead of renamed.');
document.writeln('</p>');
document.writeln('');
document.writeln('<h3>How the "Use Once" Download Link Works</h3>');
document.writeln('<p>');
document.writeln('The download file is in a directory never revealed to the person doing the downloading.');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('When a download has been completed, the download file on the server is renamed.');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('If a subsequent download is attempted, the PHP scr' + 'ipt will be unable to find the requested file because the file was renamed or deleted.');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('The PHP scr' + 'ipt allows you to specify the directory where the downloadable files are located.');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('The scr' + 'ipt also allows to you to specify the characters used to rename the file. If nothing is specified here, the downloadable file is deleted from the server instead of renamed.');
document.writeln('</p>');
document.writeln('');
document.writeln('<h3>');
document.writeln('The Single Download PHP Scr' + 'ipt');
document.writeln('</h3>');
document.writeln('<p>');
document.writeln('Here is the PHP scr' + 'ipt. Copy it and save it to your hard drive as SingleDownload.php or other appropriate file name.');
document.writeln('</p>');
document.writeln('');
document.writeln('<form>');
document.writeln('<textarea cols="36" rows="11" onclick="select()" style="margin-bottom:15px; width:350px; font-family:monospace; font-size:12px;" wrap="off" readonly="yes">');
document.writeln('&lt;?php # This must be the first line in the file, no preceding space or other characters.');
document.writeln('/* ');
document.writeln('   Single Download');
document.writeln('   Version 1.0');
document.writeln('   February 8, 2010');
document.writeln('');
document.writeln('   Will Bontrager');
document.writeln('   http://www.willmaster.com/');
document.writeln('   Copyright 2010 Bontrager Connection, LLC');
document.writeln('');
document.writeln('   Bontrager Connection, LLC grants you ');
document.writeln('   a royalty free license to use or modify ');
document.writeln('   this software provided this notice appears ');
document.writeln('   on all copies. This software is provided ');
document.writeln('   "AS IS," without a warranty of any kind.');
document.writeln('*/');
document.writeln('');
document.writeln('// Two places to customize:');
document.writeln('//');
document.writeln('// Place 1 -');
document.writeln('// Specify the directory containing the downloadable file.');
document.writeln('//    Specify directory as relative to the document root ');
document.writeln('//    directory (the directory where the domain\'s main/index ');
document.writeln('//    web page file is located). The directory may need 777 ');
document.writeln('//    permissions so scr' + 'ipt can rename files in it.');
document.writeln('');
document.writeln('$DownloadableFilesDirectory = "/secret";');
document.writeln('');
document.writeln('// Place 2 -');
document.writeln('// Specify the characters to prepend to the file name when ');
document.writeln('//    the file is renamed after being downloaded. For example, ');
document.writeln('//    if "HelloThere_" is specified here and the downloadable ');
document.writeln('//    file is named myfile.zip, then the file will be renamed ');
document.writeln('//    as HelloThere_myfile.zip after it is downloaded.');
document.writeln('// NOTE: If nothing is specified here, the file will be ');
document.writeln('//    deleted from the server after it has been downloaded, ');
document.writeln('//    instead of renamed.');
document.writeln('');
document.writeln('$FileRenamePrependCharacters = "HelloThere_";');
document.writeln('');
document.writeln('');
document.writeln('/*');
document.writeln('    No other customizations required.');
document.writeln('*/');
document.writeln('');
document.writeln('if( ! empty($FileRenamePrependCharacters) ) { $FileRenamePrependCharacters = ltrim($FileRenamePrependCharacters); }');
document.writeln('$DownloadableFilesDirectory = preg_replace(\'/^\\/*/\',\'/\',$DownloadableFilesDirectory);');
document.writeln('$DownloadableFilesDirectory = preg_replace(\'/\\/*$/\',\'\',$DownloadableFilesDirectory);');
document.writeln('$Directory = $_SERVER[\'DOCUMENT_ROOT\'].$DownloadableFilesDirectory;');
document.writeln('if( empty($_GET[\'download\']) ) { exit; }');
document.writeln('if( empty($_GET[\'savefile\']) ) { $_GET[\'savefile\'] = $_GET[\'download\']; }');
document.writeln('$Dfile = $Directory.\'/\'.$_GET[\'download\'];');
document.writeln('$size = filesize($Dfile);');
document.writeln('if( ! $size )');
document.writeln('{');
document.writeln('   echo \'&lt;p&gt;&lt;b&gt;The download file is empty or was not located.&lt;/b&gt;&lt;/p&gt;\';');
document.writeln('   exit;');
document.writeln('}');
document.writeln('$ctype = \'application/octet-stream\';');
document.writeln('header(\'Cache-control: private\');');
document.writeln('header("Content-Type: $ctype");');
document.writeln('header(\'Content-Disposition: attachment; filename="\'.$_GET[\'savefile\'].\'"\');');
document.writeln('header(\'Content-Transfer-Encoding: binary\');');
document.writeln('header("Content-Length: $fsize");');
document.writeln('@readfile($Dfile);');
document.writeln('if( empty($FileRenamePrependCharacters) ) { unlink($Dfile); }');
document.writeln('else');
document.writeln('{');
document.writeln('   $pieces = explode(\'/\',$Dfile);');
document.writeln('   $pieces[count($pieces)-1] = $FileRenamePrependCharacters . $pieces[count($pieces)-1];');
document.writeln('   rename($Dfile,implode(\'/\',$pieces));');
document.writeln('}');
document.writeln('exit;');
document.writeln('?&gt;');
document.writeln('</textarea>');
document.writeln('</form>');
document.writeln('');
document.writeln('<p>');
document.writeln('The PHP scr' + 'ipt has two places to customize.');
document.writeln('</p>');
document.writeln('<ol>');
document.writeln('<li>');
document.writeln('<p>');
document.writeln('Specify the directory containing the downloadable file.');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('Specify the directory as relative to the document root directory. The document root directory is where the domain\'s main or index web page file is located.');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('The directory may need 777 permissions so scr' + 'ipt can rename files in it. Test it first. If the file is not renamed or deleted after being downloaded, then give the directory 777 permissions.');
document.writeln('</p>');
document.writeln('</li>');
document.writeln('<li>');
document.writeln('<p>');
document.writeln('Specify the characters to prepend to the file name when renaming.');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('For example, if you specify "DONE_" and the downloaded file is myfile.pdf, then it will be renamed to DONE_myfile.pdf after it is downloaded.');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('<b>If nothing is specified here, the file on the server will be deleted instead of renamed.</b>');
document.writeln('</p>');
document.writeln('</li>');
document.writeln('</ol>');
document.writeln('');
document.writeln('<h3>Using the Software</h3>');
document.writeln('<p>');
document.writeln('Upload a file to the directory specified in the PHP scr' + 'ipt.');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('To download, use the URL of the PHP scr' + 'ipt appended with "?download=FILENAME".');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('For example, if the file to download is named myfile.zip, then the URL would be something like this:');
document.writeln('</p>');
document.writeln('<p style="overflow:auto;">');
document.writeln('<nobr>http://example.com/SingleDownload.php?download=myfile.zip</nobr>');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('With the above link, the browser will suggest the file name to save on the person\'s hard drive to be the same as the file name being downloaded.');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('To suggest a different file name to save on the person\'s hard drive, append "&savefile=FILENAME" to the URL. Example:');
document.writeln('</p>');
document.writeln('<p style="overflow:auto;">');
document.writeln('<nobr>http://example.com/SingleDownload.php?download=myfile.zip&savefile=yourfile.zip</nobr>');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('With the above URL, the file being downloaded is the one named myfile.zip on the server. It is downloaded to be saved as yourfile.zip.');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('Whenever a file is downloaded, the file on the server is either renamed or deleted depending on your customization.');
document.writeln('</p>');
document.writeln('<p>');
document.writeln('</p>');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('' + '<' + '!' + '-' + '-' + ' article end ' + '-' + '-' + '>' + '');
document.writeln('<p style="font-style: italic">');
document.writeln('Will Bontrager');
document.writeln('</p>');
document.writeln('');
document.writeln('<div style="margin-top:35px; margin-bottom:35px;">');
document.writeln('' + '<' + '!' + '-' + '-' + 'BEGIN WORD OF MOUTH TOOL CODE' + '-' + '-' + '>' + '' + '<' + '!' + '-' + '-' + '');
document.writeln('' + '-' + '-' + '>' + '<scr' + 'ipt type="text/javascr' + 'ipt">EmailSubject="I found some good information";EmailBody="My friend, read [[TITLE]] at \\n[[URL]]\\n\\nIt\\\'s good!\\n\\nRead it now because it might change.";</scr' + 'ipt>' + '<' + '!' + '-' + '-' + '');
document.writeln('' + '-' + '-' + '>' + '<div id="ltt_introdiv" style="border-style:dotted;border-width:2px;border-color:#000000;padding:5px 10px 5px 10px;background-color:white;">' + '<' + '!' + '-' + '-' + '');
document.writeln('' + '-' + '-' + '>' + '<div style="float:left;margin-right:5px;"><img src="http://word-of-mouth-advertising.com/tool/customize/icons/06.jpg" /></div><div style="margin-top:15px; font-weight:bold;"><a href="javascr' + 'ipt:revealLinkToTool(\'link_to_tool\')">Click Here</a> to share this weekly article with your online friends.</div><div style="clear:left;"></div>' + '<' + '!' + '-' + '-' + '');
document.writeln('' + '-' + '-' + '>' + '<div id="link_to_tool" style="display:none;"><scr' + 'ipt type="text/javascr' + 'ipt" src="http://word-of-mouth-advertising.com/tool/code/js/11-1244500960.js"></scr' + 'ipt><div style="font-size:smaller;text-align:center;">' + '<' + '!' + '-' + '-' + '');
document.writeln('' + '-' + '-' + '>' + 'The <a id="link_to_tool_0" target="_blank" href="http://word-of-mouth-advertising.com/">Word Of Mouth Tool</a><br/> is a gift from:<br/><a id="link_to_tool_1" target="_blank" href="http://www.willmaster.com">Website software that works</a><br/><a id="link_to_tool_2" target="_blank" href="http://nature-talk.com/locations/florida/index.html">Exploring North Florida Nature</a><br/><a id="link_to_tool_3" target="_blank" href="http://free-keyword-manager.com/">Free Keyword Manager</a><br/><br/></div></div></div>' + '<' + '!' + '-' + '-' + '');
document.writeln('' + '-' + '-' + '>' + '' + '<' + '!' + '-' + '-' + 'CUSTOMIZE:  You can customize your Word Of Mouth Tool here:  http://word-of-mouth-advertising.com/tool/customize/easy.php?11-1244500960' + '-' + '-' + '>' + '' + '<' + '!' + '-' + '-' + '');
document.writeln('' + '-' + '-' + '>' + '' + '<' + '!' + '-' + '-' + 'TERMS:  You have permission to use the Word Of Mouth Tool for free, if you don\'t alter this code in any way.' + '-' + '-' + '>' + '' + '<' + '!' + '-' + '-' + '');
document.writeln('' + '-' + '-' + '>' + '' + '<' + '!' + '-' + '-' + 'END WORD OF MOUTH TOOL CODE' + '-' + '-' + '>' + '');
document.writeln('</div>');
document.writeln('');
document.writeln('' + '<' + '!' + '-' + '-' + ' --------- --------- --------- --------- --------- --------- ' + '-' + '-' + '>' + '');
document.writeln('<scr' + 'ipt type="text/javascr' + 'ipt">');
document.writeln('// Copyright 2008 Bontrager Connection, LLC');
document.writeln('// http://www.willmaster.com/');
document.writeln('var thankyou = "Thank you! Response has been sent. Please say more if you wish."');
document.writeln('var scr' + 'iptURL = "http://www.willmaster.com/library/cgi-bin/think/MasterFormV4.cgi";');
document.writeln('var emailtemplate = "think/responsemail.txt";');
document.writeln('var filetemplate = "think/responsefile.txt";');
document.writeln('var dbfile = "think/responserecord.txt";');
document.writeln('');
document.writeln('function Thoughts_FieldContent(D,S,SS) { if( (D.value == S) || (D.value == SS) ) { D.value = ""; } }');
document.writeln('function Thoughts_RecordIt(D,ID) {');
document.writeln('var receive = scr' + 'iptURL+\'?redirect=/&\';');
document.writeln('if(emailtemplate) { receive += \'emailtemplate=\'+emailtemplate+\'&\'; }');
document.writeln('if(filetemplate) { receive += \'filetemplate=\'+filetemplate+\'&\'; }');
document.writeln('if(dbfile) { receive += \'dbfile=\'+dbfile+\'&\'; }');
document.writeln('var response = new Image();');
document.writeln('response.src = receive+\'ID=\'+escape(ID)+\'&URL=\'+escape(document.URL)+\'&RESPONSE=\'+escape(D.value);');
document.writeln('D.value = thankyou;');
document.writeln('}');
document.writeln('</scr' + 'ipt>');
document.writeln('<p style="margin-bottom: 5px;">');
document.writeln('Was this article interesting? ');
document.writeln('Does it provide information you can use? ');
document.writeln('How can it be improved? ');
document.writeln('<strong>Your comment is anonymous.</strong> ');
document.writeln('When done, click anywhere outside the box. ');
document.writeln('</p>');
document.writeln('<form style="margin: 0pt;">');
document.writeln('<textarea name="response" rows="6" cols="44" style="border-width: 2px; padding: 3px; width: 350px; background-color: rgb(204, 204, 255);" onclick="Thoughts_FieldContent(this,\'Type your response here.\',\'Thank you! Response has been sent. Please say more if you wish.\')" onblur="Thoughts_RecordIt(this,\'AFF\')">Type your response here.</textarea>');
document.writeln('</form>');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('<p>');
document.writeln('Powered by <a target="_blank" href="http://willmaster.com/master/syndicator/">Master Syndicator</a> and provided by');
document.writeln('<br /><a target="_blank" href="http://willmaster.com/possibilities/">WillMaster Possibilities</a>');
document.writeln('<scr' + 'ipt type="text/javascr' + 'ipt" language="JavaScr' + 'ipt">' + '<' + '!' + '-' + '-' + '');
document.writeln('var statsurl = \'http://www.willmaster.com/possibilities/syndication/fromload.mth\';');
document.writeln('statsurl += \'?from=\'+escape(document.URL)+\'&title=\'+escape(document.title);');
document.writeln('statsurl += \'&1\'+Math.random();');
document.writeln('document.write(\'<img src="\'+statsurl+\'" height="1" width="2" border="0">\');');
document.writeln('//' + '-' + '-' + '>' + '</scr' + 'ipt>');
document.writeln('');
document.writeln('');
document.writeln('<form target="_blank" name="a1182735724a" id="a1182735724a" action="http://www.willmaster.com/possibilities/cgi-bin/b-mailer/bmailerSubscribe.cgi" method="POST">');
document.writeln('<table border="1" cellpadding="11" cellspacing="0"><tr><td>');
document.writeln('<p style="font-weight:bold;margin:0">Subscribe to the Possibilities Ezine here</p>');
document.writeln('<input type="hidden" name="FormTypeDefault" value="T"><input type="hidden" name="redirect" value="http://willmaster.com/possibilities/thsubscribe.shtml"><input type="hidden" name="c1182735724c" value="999"><input type="hidden" name="id" value="a1182735724a">');
document.writeln('<input type="text" name="subname" size="15" value="Name" onkeyup="f311827357243f()" onclick="javascr' + 'ipt:f211827357242f(\'subname\',\'Name\');">');
document.writeln('<input type="text" name="subemail" size="15" value="Email" onkeyup="f311827357243f()" onclick="javascr' + 'ipt:f211827357242f(\'subemail\',\'Email\');">');
document.writeln('<input type="submit" value="Subscribe Free!" onclick="return f1182735724f();">');
document.writeln('</td></tr></table>');
document.writeln('</form>');
document.writeln('<scr' + 'ipt type="text/javascr' + 'ipt" language="JavaScr' + 'ipt">' + '<' + '!' + '-' + '-' + '');
document.writeln('var c311827357243c = \'document.\'+"a1182735724a"+\'.\'+"c1182735724c"+".value"+\'=\'+"5";');
document.writeln('function StripSpacesFromEnds(s) {');
document.writeln('while((s.indexOf(\' \',0) == 0) && (s.length> 1)) { s = s.substring(1,s.length); }');
document.writeln('while((s.lastIndexOf(\' \') == (s.length - 1)) && (s.length> 1)) { s = s.substring(0,(s.length - 1)); }');
document.writeln('if((s.indexOf(\' \',0) == 0) && (s.length == 1)) { s = \'\'; }');
document.writeln('return s;');
document.writeln('}');
document.writeln('function RemoveEmbeddedSpaces(s) {');
document.writeln('var i = s.indexOf(\' \',0);');
document.writeln('while(i > -1)');
document.writeln('{');
document.writeln('s = s.substring(0,i) + s.substring((i + 1),s.length);');
document.writeln('i = s.indexOf(\' \',0);');
document.writeln('}');
document.writeln('return s;');
document.writeln('}');
document.writeln('function IsItPresent(s) {');
document.writeln('if(s.length > 0) { return true; }');
document.writeln('return false;');
document.writeln('}');
document.writeln('function CheckEmail(s_email) {');
document.writeln('s_email = StripSpacesFromEnds(s_email);');
document.writeln('s_email = RemoveEmbeddedSpaces(s_email);');
document.writeln('if(IsItPresent(s_email) == false) { return false; }');
document.writeln('if( (s_email.length <6) ||');
document.writeln('    (s_email.indexOf(\'@\',0) < 1) ||');
document.writeln('    (s_email.lastIndexOf(\'@\') != s_email.indexOf(\'@\',0)) ||');
document.writeln('    (s_email.lastIndexOf(\'@\') > (s_email.length - 5)) ||');
document.writeln('    (s_email.indexOf(\'..\',0) > -1) ||');
document.writeln('    (s_email.indexOf(\'@.\',0) > -1) ||');
document.writeln('    (s_email.indexOf(\'.@\',0) > -1) ||');
document.writeln('    (s_email.indexOf(\',\',0)  > -1) )');
document.writeln('{ return false; }');
document.writeln('return true;');
document.writeln('}');
document.writeln('function f311827357243f() {');
document.writeln('document.a1182735724a.c1182735724c.value *= 13;');
document.writeln('eval(c311827357243c);');
document.writeln('}');
document.writeln('function f1182735724f() {');
document.writeln('var ret = true;');
document.writeln('if( (document.a1182735724a.subemail.value == \'Email\') || (document.a1182735724a.subemail.value.length < 1) ) { alert(\'Your email address is required.\'); ret = false; }');
document.writeln('else if(CheckEmail(document.a1182735724a.subemail.value) == false) { alert(\'Your email address is formatted incorrectly.\'); ret = false; }');
document.writeln('if( ret && (document.a1182735724a.subemail.value.length > 5) ) { eval(c311827357243c); }');
document.writeln('return ret;');
document.writeln('}');
document.writeln('function f211827357242f(k,v) {');
document.writeln('var ev = new String();');
document.writeln('eval(\'ev = document.a1182735724a.\' + k + \'.value\');');
document.writeln('if(ev == v) { eval(\'document.a1182735724a.\' + k + ".value = \'\'"); }');
document.writeln('}');
document.writeln('//' + '-' + '-' + '>' + '</scr' + 'ipt>');
// -->
