]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PYTHIA8/pythia8175/phpdoc/php.txt
Update to 8.175
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8175 / phpdoc / php.txt
1 <?php
2
3 echo "<table border = 0><tr><td align=left valign=center>";
4
5 if($_POST["resetval"] == 1)
6 {
7   //DELETE OLD FILE ON RESET
8   unlink($_POST["rmfile"]);
9 }
10
11 if (!$_POST["filename"])
12 {
13   echo "Please choose a (temporary) file name:</br>";
14   echo "<form method='POST' action='SaveParameters.php'>";
15   echo "<input type='text' name='filename'/>";
16   echo "<input type='submit' value='Submit'/>";
17   echo "</form>";
18 }
19 else if ($_POST["filename"] != "")
20 {
21   $filename = $_POST["filename"];
22   $filepath = "files/".$_POST["filename"];
23   $filecheck = file_exists($filepath);
24   
25   if(($_POST["finish"] == 1) || ($_GET["returning"] == 1))
26     {
27       $filecheck = 0;
28       $fileopen = 1;
29     }
30   
31   if ($filecheck == 1)
32     {
33       echo "<font color='red'>File in use.. choose again:</br></font>";
34       echo "<form method='POST' action='SaveParameters.php'>";
35       echo "<input type='text' name='filename'/>";
36       echo "<input type='submit' value='Submit'/>";
37       echo "</form>";
38     }
39   else
40     {
41       if(!$_POST["finish"])
42         {
43           echo "Filename chosen:<b>  "; 
44           echo $_POST["filename"];
45           echo "</br></b>";
46           echo "<table border = 0 valign = top><tr><td valign=\"top\"><form method='POST' action='SaveParameters.php'>";
47           echo "<input type='hidden' name='filename' value='".$filename."'/>";
48           echo "<input type='hidden' name='finish' value='1'/>";
49           echo "<input type='submit' value='Finish File'/>";
50           echo "</form></td>";
51           echo "<td valign=\"top\"><form method='POST' action='SaveParameters.php'>";
52           echo "<input type='hidden' name='filename' value=''/>";
53           echo "<input type='hidden' name='rmfile' value='".$filepath."'/>";
54           echo "<input type='hidden' name='resetval' value='1'/>";
55           echo "<input type='submit' value='RESET'/>";
56           echo "</form></td></tr></table>";
57         }
58       if($fileopen != 1)
59         {
60           //CREATE & OPEN FILE & CHANGE PERMISSIONS TO 666
61           $handle = fopen($filepath, 'w');
62           chmod($filepath, 0666);
63           fclose($handle);
64
65         }
66       if ($_POST["finish"])
67         {
68           echo "<b><li><a href='".$filepath."'>Right Click to Save Target: ".$filename."</a></b></br>";
69           echo "<form method='POST' action='SaveParameters.php'>";
70           echo "<input type='hidden' name='filename' value=''/>";
71           echo "<input type='hidden' name='rmfile' value='".$filepath."'/>";
72           echo "<input type='hidden' name='resetval' value='1'/>";
73           echo "<input type='submit' value='RESET'/>";
74           echo "</form>";
75         }
76     }
77 }
78
79 echo "</td><td></td></tr></table>";
80
81 ?>