I'm creating a small form to generate css files for a project, just swapping out a few colours. You can find a working example here:
I've got it working to force save a php file (that is linked via action=""
in form) as css file on load, replacing some values with values taken from the form fields.
I need to generate a few more css files, and one xml file. All the same style, taking color values and replacing.
I was thinking of creating multiple .php
files that force download in specific format with
header("Content-Disposition: attachment; filename=\"name.type\"");
However multiple files can't be inserted in the action=""
field. Is there any other way?
Or maybe generating all these files from in one .php file (though I think header()
functions affect the entire file?)?
I'd then be compiling all these files into zip, using ZipArchive
, that would be downloaded via the Download .css button.
Any help would be great.