Export data to user desktop

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Madhum
Forum Newbie
Posts: 7
Joined: Fri Feb 01, 2008 3:40 am

Export data to user desktop

Post by Madhum »

Can Someone send me the coding to export database data to the user's desktop.it's urgent.i have the coding.but it's exporting data to my root folder
and it's not exporting table field names.i want to take field names also.

can someone help me to solve this?

Thanks
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

Re: Export data to user desktop

Post by flying_circus »

Why not post YOUR coding so that we can help you to add the code necessary to get field names?

Why not change the path where the file is saved to a publicly accessible directory and then use the php header() function to direct the user to download your file?

Code: Select all

<?php
  header("location:http://www.mydomain.com/myBackUpFile.txt");
 
?>
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Export data to user desktop

Post by RobertGonzalez »

You have no control over where a file is saved on a person's computer. Exporting is simple. Google it... no one here is going to write your code for you.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Export data to user desktop

Post by John Cartwright »

And sorry to say, your urgency is not ours. Consider hiring a professional.
Post Reply