I am creating a KML file to be opened with google earth.
The contents of the file are produced dynamically from my database depending on user selection from a drop down list.
When the form is submitted the file is created and the user can either open it with google earth which works fine. The file is named svgmap.php.kml
The problem I'm having is if the user chooses save to disc then the file is saved with the name svgmap.php. The contents are correct but people can not just double click the file to open it with google earth.
Has anyone got suggestions on how to fix this?
This is my last few lines of code which creates the file
$kmlOutput = $dom->saveXML();
//Output the kml file for download
header('Content-type: application/vnd.google-earth.kml+xml');
echo $kmlOutput;
Thanks for any advice