how to export excel file in same server


Posted on 16th Feb 2014 07:03 pm by admin

My first post - php newbie, so appreciate your support.

I'm currently using headers to save web page as excel file.

$filename="sms.xls";
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: application/vnd.ms-excel");
$header="Content-Disposition: attachment; filename=".$filename.";";
header($header);
header("Content-Transfer-Encoding: binary");
@readfile($file);

I want to be able to save a copy to the server not to opening dialog save?
Not sure what I need to change or add to achieve this?

Have looked around and tried searching on here? - can't see the search threads feature if there is one?

Many thanks

No comments posted yet

Your Answer:

Login to answer
257 Like 51 Dislike
Previous forums Next forums
Other forums

Probably Easy, Need help with Check Boxes in PHP Code
hello,

Thanks for looking this over and helping me out. My problem is I have a online store l

Why is the logic of this simple code not working?
Hey, I'm trying to determine if a table already exists in mysql, but doing a query first with mysql_

paginate search result
Hi, I have a paginations script to display data from my database but i would like to paginate someon

my two tables
table1 : col1 = topicid , col2 = topic

table2 : col1 = sentid, col2 = sentence

Cod

returning data from an ssh2_exec()
here's what i got.


$conn = ssh2_connect($this->_host);
ssh2_auth_password($c

extending tidy
I have problem with type-hinting and extending tidy. This code creates error:
Code: class cMyTidy

cURL Upload Help
OK, I am creating a bridge from a local program to my website and I am trying to find the best way t

Passing Variables
What I'm wanting to do is when the user clicks on Arenas it will know the name of the country it's w

disabling a button server-side then re-enabling client-side breaks button postback
I have a tabbed container and a button (not in the container) on a page. If the first tab is selecte

Seperate team from score
I am writing a site that does a NFL Pick 'em type application and I have a feed that gives me the sc

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash