This topic is locked

Auto Export

11/25/2009 1:17:57 PM
PHPRunner General questions
S
swanside author

I have a checkbox called export. If a user checks this box, and presses save, is there a way it can automatically export this file as an xml?
cheers

Paul.

K
KevinMillican 11/25/2009

It's simpler than that, but there's a twist.

  1. Create a view on your table and pay careful attention to how the view properties of the fields are specified in the Printer-Friendly page.
  2. Enable the export page and ensure it has all the required fields checked.
  3. Create a link to the xml output page - .../yourview_export.php?type=xml

Now this will work OK once, but if the underlying data changes, the file will almost certainly be cached by your browser and won't reflect the changes.
The trick is to add something unique to the link at run-time, such as a timestamp, eg.
.../yourview_export.php?type=xml&junk=2009-11-25_22_20_00
Some javascript would probably be ideal to achieve this - I don't have anything handy because I interrogate the xml output directly using DOM.