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
Not adding to db
Hi, I can't figure out why it won't add the record to the database. It's just a simple form to get name and email but when I hit submit I get the "or die" message. Code: $Fname =
Really need helps regarding Pagination with Sort
I need someone helps regarding pagination problem...i actually want to make my page limited to let say 50 so it will look like this page1=0-50page2=51-100Then i want to sort let say based on the name
Detail Expenses Report by Cost Center
I would like to obtain a report out of SAP that shows a list of expenses by cost center that shows the vendor that the expense related to.
Including calander to page - will not show other months than current??
im trying to add an existaing calander onto a profile page by using Code: <?php include "diary/cal_show.php";?>which looks like this...But when i hit either arrows to move on
Reduce redundancies in switch functions?
Hello all! I somewhat new to PHP, and was wondering if anyone could give some suggestions on a switch function to reduce redundancies, and to efficaciously implement the script on to other
unexpected T_SL without a shift left token
Nothing too see here, I'm an idiot and resolved the problem.
Regular expression tips or resources
Hello! I'm having some issues implementing the appropriate regex patter to eliminate unwanted characters from a string.Here is a sample string: Code: String str = "test-hello. me please3, _dog[
Click counter to ignore traffic from search bots
I have a click counter on my site that...well, counts the number of clicks a link gets on the frontpage. It's a good system, but it's got a few flaws, an example being that it counts
progress bar...need expert opinion of experienced webmaster
Hey guys, quick question:I want to display a progress bar when I upload files, but I am not sure how to approach it. I have searched for hours and have found various ways of doing it. One was with
Help with explandable category tree
I have the below query: SELECT l1.id as lev1_id,l2.id as lev2_id,l3.id as lev3_id,l1.category AS lev1, l2.category as lev2, l3.category as lev3 FROM categories AS l1LEFT JOIN categories AS l2 ON