Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4382066
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:43:52+00:00 2026-05-21T12:43:52+00:00

My export script: if($_POST){ $file = ‘FKDB_XLS’; $filename = $file._.date(Y-m-d_H-i,time()); header(Content-type: application/vnd.ms-excel; charset=utf-8); //

  • 0

My export script:

if($_POST){
    $file = 'FKDB_XLS';
    $filename = $file."_".date("Y-m-d_H-i",time()); 
    header("Content-type: application/vnd.ms-excel; charset=utf-8"); // dunno if the charset does anything for this application type..
    header("Content-Disposition: attachment; filename=$filename");
    echo stripslashes($_SESSION['item']); unset($_SESSION['item']);
    exit;
}

Basicly, it just turns HTML ($_SESSION['item'] as <table>{rows}</table>) into *.xls and allows Excel to draw tables from that data, as most of you know, probably.

The problem is, when opened in Excel, everything’s OK, except… all the values are written incorrectly, with all the Ä, ņŠand so on instead of ‘Ā’ or so, again.

What should I do to prevent that?

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T12:43:53+00:00Added an answer on May 21, 2026 at 12:43 pm

    If you’re writing HTML markup for import into excel, then you need to ensure that you’re setting the appropriate meta tags in the HTML header. specifying charset in the Content type will have absolutely no effect at all. If you’re simply writing a table, then wrap it in HTML/HEAD/BODY, etc so that you can set the HEAD meta tags.

    I still don’t understand why people write HTML and give the file an xls extension when it’s so easy to create a real Excel file!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a php script to export MySQL database rows into a .txt file
I found a script on here that will export each worksheet in a file
I found a little script that will export information to an xls file, but
I have a export script that export items to a csv file. I want
I am writing a python script to parse the content of Wordpress Export XML
How do I export an environment variable from within a Ruby script to the
I'm looking for a simple C# script that will export an SVN folder. note:
I create a custom import and export, at the moment as an external script
I have a script that opens Powerpoint from my application and exports all slides.
I export an Excel document with DisplayTag. It saves as a .xls file to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.