Create KML with PHP

474 views
Skip to first unread message

Jaume Hernandez

unread,
Sep 2, 2011, 5:41:03 AM9/2/11
to KML Developer Support - KML Server Side Scripting
Hi there!!!
I've follow the tutorial by Mano Marks

(http://code.google.com/intl/es/apis/kml/articles/phpmysqlkml.html)

on how to create a KML file from a MySQL table using PHP.
It works great, but as a result I get a PHP file instead of a KML file
automatically saved in my "download" folder.
Surprisingly the PHP file is a KML with an HTML header. So, if I
manually erase the header and save it as a KML it is perfect.

I think it is a problem when generating the file but I'm a newby on
programming and I can't solve it.
PLEASE, PLEASE, any help is highly appreciated
Jaume

Rossko

unread,
Sep 10, 2011, 6:17:44 AM9/10/11
to KML Developer Support - KML Server Side Scripting
> It works great, but as a result I get a PHP file instead of a KML file
> automatically saved in my "download" folder.

Are you sure you included the line
header('Content-type: application/vnd.google-earth.kml+xml');
Reply all
Reply to author
Forward
0 new messages