## Save Settings

The information on this webpage is only valid if you access the PHP dynamic webpages via a web browser, and does not apply to the static HTML equivalents. With PHP, all of the settings in the PYTHIA program are represented by radio buttons or fill-in boxes, that makes it easy for you to construct a file with your desired changes. This file can then be read into PYTHIA by your main program to steer the whole run.

### Basic instructions

The functionality of the PHP option is described in the following.

- To begin with, you must specify a (temporary) file name in the box above. If the filename already exists on the server, you will be requested to pick a new name.

- Once you have Submitted your filename, you can browse through the pages and make your selections. The values currently selected when you load the page are the default values.

- When you have finished making your changes to a particular page, you must click on Save Settings at the bottom of the page. This will write the changes to your temporary file. If you make a mistake, just repeat the procedure for that category again.

- When you have finished all the changes you need, return to this page and click Finish File.

- You will then get up a link, that you are asked to right-click with your mouse (or equivalent).

- In the menu that appears, pick the option Save Link As (or equivalent).

- You will now get up a file browser, for you to pick and Save the location and file name (the latter by default the same as the temporary file name).

- At any time, if you click the RESET button, your temporary file will be erased and you can start anew.

- Before you use a file, be sure to check it visually to confirm that you saved what you intended to. Minor corrections are easily made in a text editor.

### Supplementary notes

The documentation files exist in three versions.

1. As a set of `.xml` files, in the `xmldoc/` subdirectory. These are the master copies that no user ever should touch, but that are used to generate the variants below.

2. As a set of `.html` files, in the `htmldoc/` subdirectory. You can open your own locally installed copy of the `Welcome.html` file in your web browser and thereafter navigate among all the pages. You can learn which parameters are free to be changed, but not change anything, except by brute-force cut-and-paste to a file of your own.

3. As a set of `.php` files, in the `phpdoc/` subdirectory. For these files to provide the functionality described above they have to accessed via a webserver. The one where you have your homepage should work fine. Alternatively you can use pages already available on another server.

A few further comments about the operation of the PHP option:

- To set up the PHP files on your webserver, you have to install the whole `phpdoc/` subdirectory there. In addition to the `.php` code this includes a few more files, plus a subdirectory named `files` where the temporary files are stored. This subdirectory must have public write access to work (`chmod a+w files` if not).

- The "temporary" files stored in `files` actually remain unless the RESET button is used. The good news is that this makes it possible to recover a file that otherwise might be lost. The bad news is that the `files` directory may need to be cleaned up from time to time. (But typically the files are pretty small, so this should not be a major problem.)

- When you click the Save Settings button on the bottom of a page all changed settings are written on the temporary file in the format

      name-of-flag/mode/parameter/word = value

  with one variable per line. Thereafter all the settings on the page are restored to their default values.

- You can return to a page to do some further changes and save those. If you change the same parameter twice, it is the last value that counts. (Both values are stored in the file, with the more recent lower down, and then PYTHIA does the changes sequentially.) However remember that unchanged values are not stored, so if you want to restore some default value it may be simpler to edit the file afterwards.

- The changeable flags/modes/parameters/words are mainly in the "Setup Run Tasks" section of the index, but a few (less frequently used ones) can also be found lower down, in the "Study Output" and "Link to Other Programs" pages.

- It is not (yet) possible to modify particle data within the PHP-based setup approach. This is a more difficult task, since e.g. the modifications one may want to do in a decay table can be quite interrelated.