fititnt
unread,Jun 7, 2009, 4:48:23 PM6/7/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Joomla! General Development
I'm having a problem to run php code inside the joomla.
I will give a simple example.
The code below would normally save you a file that is in a directory.
//start
$file = "nome_arquivo.txt";
header("Content-Type: application/save");
header("Content-Length:".filesize($file));
header('Content-Disposition: attachment; filename="' . $file . '"');
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Pragma: no-cache');
$fp = fopen("$file", "r");
fpassthru($fp);
//end
Outside of joomla, it works without problems, however, if I put inside
one administrator component, the generated file will contain ALL the
contents of one new html page in joomla instead of what it should
contain only.
This code is only an example of some more complex applications that I
would do.
In that case, what should I do to save the file it only what they
should and not the entire HTML that would be expected in a new page?