I have a PHP file called dynamicxml.php
that runs a bunch of code, draws data from a database and creates an XML file. When I right-click and save the link for dynamicxml.php?var=test
I need the dialog box to select xml as the default file type and rename the file to var.xml:
header("Content-type: text/xml");
echo '<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<blah><blah_blah>'.$_GET['var'].'</blah></blah>';
When clicking the link it loads the xml file in the browser. Saving that page saves it as var.xml. But right clicking and saving it saves it as dynamicxml.php and as a php file type.
Should I manipulate things with htaccess or are there other alternatives?