Hi.
I'm rather confused with forcing a download. I just want to save dynamic content (from $_SESSION[''] data) as a .html file.
The script to do this is a PHP page, but when I click on "download" it downloads as "download.php"
Here's the code:
Code: header("Cache-control: private"); //IE 6 Fix
if (isset($_GET['download']) && $_GET['download']=="true" && isset($_GET['filename']) && $_GET['filename']!="") {
// retrieve content of the file here, e.g. from a database...
$content=$_SESSION['old_page'];
// send the header here
header('Content-type: text/plain');
header('Content-Disposition: attachment; filename="' . $_GET['filename']);
// put the content in the file
echo($content);
// stop processing the page
exit;
}
It's accessed using: Code: <a href="../outputs/download_as_file.html?download=true&filename=shine_output.html">Download</a>
Any suggestions? I found a good tutorial here: http://richardlynch.blogspot.com/2006/06/php-downloads-content-disposition.html but don't think it'll do what I need to do
why aint this working?
i have this code:Code: $num = 250; $count = ($num - $rcount); echo $rcount; echo ""; echo $count;when i echo $rcount it gives me 153...so my calculations is 250-153 = 97.but
Month String to Numeric?
Hi guys,Given a month as a string, is there a simple way to find the numeric representation of said month?I've used a switch statement but I'm wondring if there is a more elegant way of doing
Extract specific information from a PHP Multidimensional Array
Howdy! I've racked my brain over this for 24 hours now. I think it's time I asked for help. I'm learning PHP and believe my I've manipulated many code blocks trying to get this to work with for and
DATEDIFF Question
First time post, and of course it is a help question.I am using a WP plug-in to display previous and next games in a season. (Leaguemanager is the plug-in name - Link
Search function
I am looking for some guidance from the experts.I am trying to create a search function. It will only be searching one table. The search criteria consists of two drop down menus. Each menu lists
button.click += new eventhandler() not works in if(!ispostback)
i want to use button.clcik event in function VIewScrap() which is called in if(!ispostback) but itdoes not works any slolution ?
Is it possible to stop reservation creation in PM Order?
Hi All,
cookie problem
I hv a website url In this site main menu functionality based on cookie when user click on particular menu the visited menu change its color and cookie is created for that menu and when user click on
ASP.NET 2.0 - Enter Key - Default Submit Button
Hi,One of the most annoying things in developing web pages is handling the "Enter key" for form submission. Enter key has been the favourite way users like to submit forms. Though we provide Buttons
Select all entries from database that include a phrase
I have a database of clubs - one of the categories is meeting time and placeI would like to have a page that looks something like this:Monday:club1club2club3Tuesday:club1club2club3etc.and each club is