Answer the question
In order to leave comments, you need to log in
How to give a file on the fly?
The function generates an xml file for subsequent return to the user.
It looks like this:
<?php
header("Content-Type: text/xml");
header("Content-disposition: attachment; filename=myFile.xml");
echo get_xml();
exit;
function get_xml()
{
$xml = '';
$xml .= 'bla-bla-bla';
return $xml;
}
Unable to connect to site.
The page may be temporarily unavailable or moved to a new address.
ERR_INVALID_RESPONSE
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question