Index: trunk/ippData/htdocs/docs.txt
===================================================================
--- trunk/ippData/htdocs/docs.txt	(revision 33988)
+++ trunk/ippData/htdocs/docs.txt	(revision 33988)
@@ -0,0 +1,123 @@
+<h2>DVO Documentation</h2>
+
+<h3>Release Notes on 3pi.20120525</h3>
+
+This database contains PS1 3pi observations through 2012/01/21.  The
+ubercal zero points have been applied to all exposures included in
+that analysis.  The remaining exposures have been tied to the ubercal
+system via relative photometry.  The ubercal measurements are given
+10x their poisson weight to ensure they drive the photometric
+solution.
+
+The database has been merged with the PS1 Synthetic photometry
+database (based on 2MASS and USNO-B).  For objects brighter than the
+saturation limit, the Synthetic photometry has been used for the mean
+magnitudes (these can be identified by having bit 0x04 raised in the
+mean filter flags).  Objects which used ubercal photometry have the
+bit 0x08 raised in the mean filter flags.  
+
+This database has also been merged with the 2MASS, WISE, and
+SuperCOSMOS databases.  The following photcodes are used for those
+external photometric sources:
+
+<table class="page">
+<tr><th> Source </th><th> Photcode </th></tr>
+<tr><td> 2MASS_J </td><td> 2011 </td></tr>   
+<tr><td> 2MASS_H </td><td> 2012 </td></tr>   
+<tr><td> 2MASS_K </td><td> 2013 </td></tr>   
+<tr><td> WISE_W1 </td><td> 2014 </td></tr>   
+<tr><td> WISE_W2 </td><td> 2015 </td></tr>   
+<tr><td> WISE_W3 </td><td> 2016 </td></tr>   
+<tr><td> WISE_W4 </td><td> 2017 </td></tr>   
+<tr><td> SYNTH.g </td><td> 3001 </td></tr>   
+<tr><td> SYNTH.r </td><td> 3002 </td></tr>   
+<tr><td> SYNTH.i </td><td> 3003 </td></tr>   
+<tr><td> SYNTH.z </td><td> 3004 </td></tr>   
+<tr><td> SYNTH.y </td><td> 3005 </td></tr>
+<tr><td> SCOS.103a.E       </td><td>      1150  </td></tr>
+<tr><td> SCOS.4414.OG590   </td><td>      1151  </td></tr>
+<tr><td> SCOS.4415.OG590   </td><td>      1152  </td></tr>
+<tr><td> SCOS.IIIaF.OG590  </td><td>      1153  </td></tr>
+<tr><td> SCOS.IIIaF.RG610  </td><td>      1154  </td></tr>
+<tr><td> SCOS.IIIaF.RG630  </td><td>      1155  </td></tr>
+<tr><td> SCOS.IIIaJ.GG385  </td><td>      1156  </td></tr>
+<tr><td> SCOS.IIIaJ.GG395  </td><td>      1157  </td></tr>
+<tr><td> SCOS.IVN.RG715    </td><td>      1158  </td></tr>
+<tr><td> SCOS.IVN.RG9      </td><td>      1159  </td></tr>
+</table>
+
+<img width=1000px src="relphot.20120528/sigma.i.ubercal.20120528.v0.png"><br>
+Map of the mean per-star residual (inst mag brighter than -10) for
+i-band (ubercal data only).
+<br>
+
+<img width=1000px src="relphot.20120528/sigma.g.ubercal.20120528.v0.png"><br>
+Map of the mean per-star residual (inst mag brighter than -10) for
+g-band (ubercal data only).
+<br>
+
+<h3>Comparison with 2MASS</h3>
+
+The plots below compare the PS1 grizy photometry with 2MASS photometry
+by examining the location of the color-color locus for early (&lt; K0)
+main sequence stars.
+
+For each pixel (0.5 degree on a side), I select all objects with PS1 r
+&lt; 20 and detected JHK magnitudes, keeping only those with S/N in
+the mean &gt; 50 and standard deviations less than 0.05 magnitudes.  I
+then fit the stellar locus in g-r,r-i for the g-r range 0.2 to 1.0,
+and keep only objects that fall within 0.05 of that (linear) stellar
+locus fit.<br>
+
+I then fit the stellar locus with a line in each of the color-color diagrams
+g-i,i-J; g-i,i-H; g-i,i-K.  I measure the mean i-J color expected from
+the fit for stars with g-i = 0.5.  The figures below show the maps of
+the i-J, i-H, and i-K offsets as well as the J-H and H-K offsets at
+g-i = 0.5.  The center of these maps is RA,DEC = 0,0, (east is left,
+north is up).  The pixels are 0.5 degrees on a side.<br> 
+
+These maps show three main features.  The Galactic Plane is quite
+clear, and not surprising: this test is particularly sensitive to
+reddening. <br>
+
+Several large scale patches are also visible (eg, the black patch near
+RA ~ 150 deg).  Disappointingly, these correspond to areas without
+good ubercal ties -- in other words, these are regions in which the
+data were obtained in non-photometric conditions.  This shows the
+limitation of using relative photometry to tie across individual
+exposures.  If the exposures have an extinction gradient, the
+correction far from the photometrically tied region can drift from the
+correct value.  The largest region at RA ~ 150 matches a section with
+poor i-band photometry and has a depth of roughly 0.1 magnitudes in
+i-J.  Assuming this is completely due to i-band errors, this
+corresponds to about 0.06 magnitudes of drift to the center of this
+region. <br>
+
+The third pattern is at a lower level of intensity: N-S strips with
+roughly E-W bands.  They are most noticable in K and H-K.  These
+appear to correspond well to the 2MASS scanning pattern, and have an
+amplitude corresponding to about 0.02 - 0.04 magnitudes of offset in
+K.  <br>
+
+<img width=1000px src="relphot.20120528/dJ.allsky.20120528.v3.png"><br>
+Map of the i-J color at g-i = 0.5. 
+<br>
+
+<img width=1000px src="relphot.20120528/dH.allsky.20120528.v3.png"><br>
+Map of the i-H color at g-i = 0.5. 
+<br>
+
+<img width=1000px src="relphot.20120528/dK.allsky.20120528.v3.png"><br>
+Map of the i-K color at g-i = 0.5. 
+<br>
+
+Combinations of the above maps can highlight any problems in 2MASS
+which are driven by the color rather than the mean magnitudes.
+
+<img width=1000px src="relphot.20120528/dJH.allsky.20120528.v3.png"><br>
+Map of the J-H color at g-i = 0.5. 
+<br>
+
+<img width=1000px src="relphot.20120528/dHK.allsky.20120528.v3.png"><br>
+Map of the H-K color at g-i = 0.5. 
+<br>
Index: trunk/ippData/htdocs/help.txt
===================================================================
--- trunk/ippData/htdocs/help.txt	(revision 33988)
+++ trunk/ippData/htdocs/help.txt	(revision 33988)
@@ -0,0 +1,13 @@
+<h2>DVO Distribution Help</h2>
+
+<p> These web pages contain the PS1 DVO databases, making it easy to
+download entire databases with the 'wget' command.  It is necessary to
+include an authorized user and the password.</p>
+
+
+Use a wget command on the directory of interest, eg:
+
+<tt> wget --user=ps1sc --password=(PASS) -r -np -nH http://dvodist.ipp.ifa.hawaii.edu/3pi.20120509 </tt>
+
+Ask your DRAVG representative if you need the password.
+
Index: trunk/ippData/htdocs/index.info.txt
===================================================================
--- trunk/ippData/htdocs/index.info.txt	(revision 33988)
+++ trunk/ippData/htdocs/index.info.txt	(revision 33988)
@@ -0,0 +1,5 @@
+<h2>Pan-STARRS 1 Data Distribution Server</h2>
+
+<p> These web pages contain the PS1 data for public release</p>
+
+<br><br>
Index: trunk/ippData/htdocs/index.php
===================================================================
--- trunk/ippData/htdocs/index.php	(revision 33988)
+++ trunk/ippData/htdocs/index.php	(revision 33988)
@@ -0,0 +1,59 @@
+<?php 
+
+$utils = "/export/ipp002.0/www/localhost/utils";
+
+include "$utils/ipp.php";
+
+// if we come in directly, the top-level directory should be /dvodist
+// if we come in from the ippops1 proxy, we need to set the root to /
+$ifaProxy = "128.171.227.208";
+
+// is the request coming from our proxY?
+// $fromProxy = $_SERVER['HTTP_X_FORWARDED_FOR'] && ($_SERVER['REMOTE_ADDR'] == $ifaProxy);
+// if ($fromProxy) ... 
+$rootdir = "";
+
+menu("$utils/ipp.menu.dat", 'DVO Distribution Server', $rootdir, "$rootdir/ipp.css", '', '');
+
+$script = basename($_SERVER[SCRIPT_NAME]);
+
+if ($script == "index.php") {
+  verbatim ("index.info.txt");
+  dirlist ("index.txt");
+ }
+
+if ($script == "docs.php") {
+  verbatim ("docs.txt");
+ }
+
+if ($script == "help.php") {
+  verbatim ("help.txt");
+ }
+
+menu_end();
+?>
+
+// generic proxy detection
+// if ( $_SERVER['HTTP_X_FORWARDED_FOR']
+//      || $_SERVER['HTTP_X_FORWARDED']
+//      || $_SERVER['HTTP_FORWARDED_FOR']
+//      || $_SERVER['HTTP_CLIENT_IP']
+//      || $_SERVER['HTTP_VIA']
+//      || in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554))
+//      || @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 30))
+//   {
+//     exit('Proxy detected');
+//   }
+
+// list server info:
+// $varlist = array ('SCRIPT_NAME', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'HTTP_VIA', 'REMOTE_ADDR');
+// 
+// foreach ($varlist as $name) {
+//   echo "$name : $_SERVER[$name]<br>\n";
+// }
+// 
+// echo "get list<br>\n";
+// foreach ($_GET as $key => $value) {
+//   echo "$key : $value<br>\n";
+// }
+
Index: trunk/ippData/htdocs/index.txt
===================================================================
--- trunk/ippData/htdocs/index.txt	(revision 33988)
+++ trunk/ippData/htdocs/index.txt	(revision 33988)
@@ -0,0 +1,4 @@
+# Name                   : link                       : type  : style : info
+Data Product  	         : none                       : plain : title : Comment
+PS1 Photometry Ladder v0 : photladder.20120604.subset : dir   : dir1  : Photometry Ladder released 2012.06.07 (EAM UPDATE)
+Synthetic Photometry DVO : catdir.syn.test            : dir   : dir1  : Demonstration DVO Database
Index: trunk/ippData/htdocs/ipp.css
===================================================================
--- trunk/ippData/htdocs/ipp.css	(revision 33988)
+++ trunk/ippData/htdocs/ipp.css	(revision 33988)
@@ -0,0 +1,421 @@
+
+/* internal link line: c0d0d0 : d8d0f0
+   external link line: 303070 
+   border:             0080c0
+ */
+
+body  { 
+    background-color: #a0d0e0; 
+    padding: 5px; 
+    margin: 5px
+}
+
+h1 {
+    margin-top: 0.05em;
+    margin-bottom: 0.05em;
+}
+
+h2 {
+    margin-top: 0.05em;
+    margin-bottom: 0.05em;
+}
+
+h3 {
+    margin-top: 0.05em;
+    margin-bottom: 0.05em;
+}
+
+h4 {
+    margin-top: 0.05em;
+    margin-bottom: 0.05em;
+}
+
+div.debug {
+    height: 15%;
+    background-color: #ffffaa;
+    overflow: auto;
+}
+
+a:link, a:visited, a:active { 
+    text-decoration: underline; 
+    font-weight: bold; 
+    color: #ff0000
+}
+
+a.button      { 
+    text-decoration: none; 
+    font-weight: bold;   
+    color: #000000; 
+    background: #0080c0
+}
+a.menutop     { 
+    text-decoration: none; 
+    font-weight: bold;   
+    color: #ffffff
+}
+a.menutops    { 
+    text-decoration: none; 
+    font-weight: bold;   
+    color: #80f0ff
+}
+a.menuext     { 
+    text-decoration: none; 
+    font-weight: bold;   
+    color: #ffffff
+}
+a.menulink    { 
+    text-decoration: none; 
+    font-weight: normal; 
+    color: #000000
+}
+a.menuselect  { 
+    text-decoration: none; 
+    font-weight: normal; 
+    color: #0000ff
+}
+a.piclink     { 
+    text-decoration: none; 
+    font-weight: normal; 
+    color: #0080c0
+}
+
+table.dirlist { text-align: left; 
+             font-size: small; 
+	     font-weight: normal; 
+	     background: #303030; 
+	     border: 1px solid #000000; 
+	     padding: 1px; 
+}
+
+a.dir1     { 
+    text-decoration: none; 
+    font-weight: bold;   
+    color: #800080
+}
+a.dir2     { 
+    text-decoration: none; 
+    font-weight: bold;   
+    color: #800080
+}
+a.file1     { 
+    text-decoration: none; 
+    font-weight: bold;   
+    color: #800080
+}
+a.file2     { 
+    text-decoration: none; 
+    font-weight: bold;   
+    color: #800080
+}
+tr.dir1    { 
+    text-align: left; 
+    background: #d0d0d0; 
+    font-size: small; 
+    color: #000000; 
+    padding: 1px; 
+}
+tr.dir2    { 
+    text-align: left; 
+    background: #d0d0ff; 
+    font-size: small; 
+    color: #000000; 
+    padding: 1px; 
+}
+tr.file1    { 
+    text-align: left; 
+    background: #d0d0d0; 
+    font-size: small; 
+    color: #000000; 
+    padding: 2px; 
+}
+tr.file2    { 
+    text-align: left; 
+    background: #d0d0ff; 
+    font-size: small; 
+    color: #000000; 
+    padding: 2px; 
+}
+tr.break    { 
+    text-align: left; 
+    background: #0080c0; 
+    font-size: small; 
+    color: #ffffff; 
+    padding-top: 4px; 
+}
+tr.title    { 
+    text-align: left; 
+    background: #d0d0ff; 
+    font-size: medium; 
+    color: #000000; 
+    padding: 2px; 
+    padding-top: 4px; 
+    padding-bottom: 4px; 
+}
+
+td.menutop    { 
+    text-align: left; 
+    background: #0080c0; 
+    font-size: small; 
+    color: #ffffff; 
+    padding: 2px; 
+}
+td.menutops   { 
+    text-align: left; 
+    background: #0080c0; 
+    font-size: small; 
+    color: #000000; 
+    padding: 2px; 
+}
+td.menuext    { 
+    text-align: left; 
+    background: #303070; 
+    font-size: small; 
+    color: #ffffff; 
+    padding: 2px; 
+}
+td.menulink   { 
+    text-align: left; 
+    background: #d0d0ff; 
+    font-size: small; 
+    color: #000000; 
+    padding: 2px; 
+    font-weight: normal; 
+    text-indent: 0px; 
+}
+td.menuselect { 
+    text-align: left; 
+    background: #d0d0ff; 
+    font-size: small; 
+    color: #ff0000; 
+    padding: 2px; 
+    font-weight: normal; 
+    text-indent: 0px; 
+}
+td.menuline   { 
+    text-align: left; 
+    background: #d0d0ff; 
+    font-size: small; 
+    color: #000000; 
+    padding: 2px; 
+    font-weight: normal; 
+    text-indent: 0px; 
+}
+
+td.picture    { 
+    text-align: left; 
+    background: #00ffff; 
+    font-size: small; 
+    color: #ff0000; 
+    padding: 0px; 
+    text-indent: 2px; 
+    font-weight: normal; 
+}
+td.piclink    { 
+    text-align: left; 
+    background: #0080c0; 
+    font-size: small; 
+    color: #ff0000; 
+    padding: 0px; 
+    text-indent: 0px; 
+    font-weight: normal; 
+}
+
+table.page { 
+    border: 0px solid #0080c0; 
+    background: #a0d0e0; 
+    padding: 0px
+}
+
+td.title { 
+    background-color: #ff0000; 
+    padding: 5px; 
+    font-size: x-large; 
+    text-align: left; 
+    vertical-align: top
+}
+
+td.body  { 
+           text-align: left; 
+           font-size: small;  
+           font-weight: normal;  
+           vertical-align: top;
+	   background: #d0d0ff; 
+	   background-color: #d0d0ff; 
+	   border: 3px solid #0080c0; 
+	   padding: 5px; 
+}
+
+table.menu { 
+    text-align: left; 
+    font-size: small; 
+    font-weight: normal; 
+    background: #ff0000; 
+    border: 3px solid #0080c0; 
+    padding: 0px; 
+}
+
+table.select { 
+    text-align: left; 
+    font-size: small; 
+    font-weight: normal; 
+    background: #0080c0; 
+    border: 1px solid #0080c0; 
+    padding: 0px; 
+}
+
+td.select  { 
+    text-align: left; 
+    font-size: small;  
+    font-weight: bold;  
+    vertical-align: top;
+    color: #ffffff; 
+    background: #0080c0; 
+    background-color: #0080c0; 
+    border: 2px solid #0080c0; 
+    padding: 2px; 
+}
+
+th.select  { 
+           text-align: left; 
+           font-size: small;  
+           font-weight: bold;  
+           vertical-align: top;
+	   color: #000000; 
+	   background: #d0d0ff; 
+	   background-color: #d0d0ff; 
+	   border: 0px solid #0080c0; 
+	   padding: 2px; 
+}
+
+table.list { text-align: left; 
+             font-size: small; 
+	     font-weight: normal; 
+	     background: #d0d0ff; 
+	     border: 2px solid #ffffff; 
+	     padding: 0px; 
+}
+
+td.list  { 
+           text-align: left; 
+           font-size: small;  
+           font-weight: normal;  
+           vertical-align: top;
+	   background: #d0d0ff; 
+	   background-color: #d0d0ff; 
+	   border: 2px solid #000000; 
+	   padding: 2px; 
+}
+
+td.list_off  { 
+           text-align: left; 
+           font-size: small;  
+           font-weight: normal;  
+           vertical-align: top;
+	   background: #a0a0a0; 
+	   background-color: #a0a0a0;
+	   border: 2px solid #000000; 
+	   padding: 2px; 
+}
+
+td.list_drop  { 
+           text-align: left; 
+           font-size: small;  
+           font-weight: normal;  
+           vertical-align: top;
+	   background: #a0a0a0; 
+	   background-color: #a0a0a0;
+	   border: 2px solid #000000; 
+	   padding: 2px; 
+}
+
+td.list_run  { 
+           text-align: left; 
+           font-size: small;  
+           font-weight: normal;  
+           vertical-align: top;
+	   background: #ffa0a0; 
+	   background-color: #ffa0a0;
+	   border: 2px solid #000000; 
+	   padding: 2px; 
+}
+
+td.det_off  { 
+           text-align: left; 
+           font-size: small;  
+           font-weight: normal;  
+           vertical-align: top;
+	   background: #a0a0a0; 
+	   background-color: #a0a0a0;
+	   border: 2px solid #000000; 
+	   padding: 2px; 
+}
+
+td.det_drop  { 
+           text-align: left; 
+           font-size: small;  
+           font-weight: normal;  
+           vertical-align: top;
+	   background: #a0a0a0; 
+	   background-color: #ffa0a0;
+	   border: 2px solid #000000; 
+	   padding: 2px; 
+}
+
+td.det_add  { 
+           text-align: left; 
+           font-size: small;  
+           font-weight: normal;  
+           vertical-align: top;
+	   background: #ffa0a0; 
+	   background-color: #a0a0ff;
+	   border: 2px solid #000000; 
+	   padding: 2px; 
+}
+
+th.list  { 
+           text-align: left; 
+           font-size: small;  
+           font-weight: bold;  
+           vertical-align: top;
+	   background: #d0d0ff; 
+	   background-color: #d0d0ff; 
+	   border: 2px solid #000000; 
+	   padding: 2px; 
+}
+
+td.ul3x2    { 
+    text-align: right; 
+    vertical-align: bottom;
+    padding: 0px; 
+    text-indent: 0px; 
+}
+td.uc3x2    { 
+    text-align: center; 
+    vertical-align: bottom;
+    padding: 0px; 
+    text-indent: 0px; 
+}
+td.ur3x2    { 
+    text-align: left; 
+    vertical-align: bottom;
+    padding: 0px; 
+    text-indent: 0px; 
+}
+td.ll3x2    { 
+    text-align: right; 
+    vertical-align: top;
+    padding: 0px; 
+    text-indent: 0px; 
+}
+td.lc3x2    { 
+    text-align: center; 
+    vertical-align: top;
+    padding: 0px; 
+    text-indent: 0px; 
+}
+td.lr3x2    { 
+    text-align: left; 
+    vertical-align: top;
+    padding: 0px; 
+    text-indent: 0px; 
+}
Index: trunk/ippData/scripts/mkindex.sh
===================================================================
--- trunk/ippData/scripts/mkindex.sh	(revision 33988)
+++ trunk/ippData/scripts/mkindex.sh	(revision 33988)
@@ -0,0 +1,37 @@
+#!/bin/csh -f 
+
+if ($#argv != 1) then
+  echo "USAGE: mkindex.sh (dir)"
+  exit 2
+endif
+
+set topdir = $argv[1]
+
+# this is weak: depends on root location
+ln -s /export/ipp002.0/www/localhost/htdocs/ippData/index.php $topdir/
+
+set file = `basename $topdir`
+echo "$file : $file : plain : title  : Title" > $topdir/index.txt
+echo "..    : ..    : dir   : dir2   : parent directory" >> $topdir/index.txt
+
+set N = 1
+foreach entry ($topdir/*)
+  set file = `basename $entry`
+  if ("$file" == "index.php") continue
+  if ("$file" == "index.txt") continue
+
+  if (-d $entry) then
+    echo "$file : $file : dir : dir$N : directory" >> $topdir/index.txt
+    /export/ipp002.0/www/localhost/scripts/mkindex.sh $entry
+  endif
+
+  if (-f $entry) then
+    echo "$file : $file : file : file$N : database file" >> $topdir/index.txt
+  endif
+
+  if ($N == 1) then
+    set N = 2
+  else
+    set N = 1
+  endif
+end
Index: trunk/ippData/utils/blank.html
===================================================================
--- trunk/ippData/utils/blank.html	(revision 33988)
+++ trunk/ippData/utils/blank.html	(revision 33988)
@@ -0,0 +1,10 @@
+<html>
+<head>
+  <title> Load and Setup </title>
+</head>
+
+<link rel="STYLESHEET" HREF="ipp.css">
+<body>
+
+test index<br>
+</body></html>
Index: trunk/ippData/utils/ipp.menu.dat
===================================================================
--- trunk/ippData/utils/ipp.menu.dat	(revision 33988)
+++ trunk/ippData/utils/ipp.menu.dat	(revision 33988)
@@ -0,0 +1,20 @@
+# style   | select-style | type    | menu line                    | link page       
+
+piclink   | piclink      | piclink | /PScolorlogo2.jpg            | http://panstarrs.ifa.hawaii.edu
+menuext   | menuext      | link    | Pan-STARRS public            | http://panstarrs.ifa.hawaii.edu
+menuext   | menuext      | link    | Pan-STARRS project           | http://panstarrs.ifa.hawaii.edu/project
+menuext   | menuext      | link    | Pan-STARRS IPP Wiki          | http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki
+menuext   | menuext      | link    | PS1SC Wiki                   | http://ps1sc.ifa.hawaii.edu/PS1wiki/index.php/Main_Page
+
+menutop   | menutop      | plain   | &nbsp;                       | 
+menutop   | menuselect   | link    | Pan-STARRS Data              | /index.php
+menutop   | menuselect   | link    | Documentation                | /docs.php
+menutop   | menuselect   | link    | Help                         | /help.php
+
+
+# we have four valid menu types: picture, piclink, link, plain
+# picture   | picture    | picture | PScolorlogo2.jpg             | none
+# piclink   | piclink    | piclink | PScolorlogo2.jpg             | http://panstarrs.ifa.hawaii.edu
+# menulink  | menuselect | link    | other page                   | notest.php     
+# menutop   | menutop    | plain   | foo bar                      | none            
+
Index: trunk/ippData/utils/ipp.php
===================================================================
--- trunk/ippData/utils/ipp.php	(revision 33988)
+++ trunk/ippData/utils/ipp.php	(revision 33988)
@@ -0,0 +1,206 @@
+<?php
+
+global $realroot;
+$realroot = "/dvodist";
+
+function head ($title) {
+  echo "<head>\n";
+  echo "  <title> $title </title>\n";
+  /* JavaScript code */
+  echo "  <script type=\"text/javascript\">\n";
+  echo "  function changeCell(cellId, newContent){\n";
+  echo "    document.getElementById(cellId).innerHTML=newContent;\n";
+  echo "  }\n";
+  echo "  </script>\n";
+  echo "</head>\n\n";
+}
+
+function menu ($source, $title, $root, $sheet, $append, $project) {
+
+  echo "<html>\n";
+  head($title);
+  echo "<link rel=\"STYLESHEET\" HREF=\"$sheet\">\n";
+  echo "<body>\n";
+
+  if (! $project) { $project = "none"; }
+
+  // echo "<p style=\"font-size:50%\">host: $WWWHOST, db: $DBHOST</p>\n";
+  echo "<table class=page cellspacing=10px><tr><td valign=top>\n";
+  echo "<table class=menu cellspacing=0px>\n";
+
+  menulines ($source, $root, $append, $project);
+
+  echo '</table></td><td class="body" valign=top>', "\n\n";
+}
+
+function menulines ($source, $root, $append, $project) {
+
+  $file = fopen ($source, "r");
+
+  // loop over the lines in the file and generate lines in the menu
+  while ($line = fgetcsv ($file, 1024, "|")) {
+    if (ereg ('^[:blank:]*#', $line[0])) continue;
+    if (count($line) < 2) continue;
+
+    if (count($line) == 2) {
+      $value = trim($line[0]);
+      if ($value == "input") {
+        $value = trim($line[1]);
+        menulines ($value, $root, $append, $project);
+      }
+      continue;
+    }
+    if (count($line) != 5) continue;
+
+    $type = trim($line[2]);
+    $name = trim($line[3]);
+    $base = trim($line[4]);
+
+    if (preg_match ('|\$PROJECT|', $name)) {
+      $name = preg_replace ('|\$PROJECT|', $project, $name);
+    }
+
+    // append additional elements if needed
+    if ($append) {
+      $link = "$base" . "?" . $append;
+    } else {
+      $link = "$base";
+    }
+	
+    // prepend the rootdir if needed (reference to /)
+    if ($link[0] == '/') {
+      $link = $root . $link;
+    } 
+
+    global $realroot;
+
+    // hi-lite the current page (use select-style, not style)
+    $thisname = $_SERVER[SCRIPT_NAME]; 
+    $page = $realroot . $base;
+    if ($page == $thisname) {
+      $style = trim($line[1]);
+    } else { 
+      $style = trim($line[0]);
+    }       
+
+    switch ($type) { 
+    case 'plain':
+      echo "<tr><td class=\"$style\"> $name </td></tr>\n";  
+      break;
+    case 'picture':
+      // prepend the rootdir if needed (reference to /)
+      if ($name[0] == '/') {
+	$name = $root . $name;
+      } 
+      echo "<tr><td class=\"$style\"> <img src=\"$name\"> </td></tr>\n";     
+      break;
+    case 'piclink':
+      // prepend the rootdir if needed (reference to /)
+      if ($name[0] == '/') {
+	$name = $root . $name;
+      } 
+      echo "<tr><td class=\"$style\"> <a class=\"$style\" href=\"$link\"> <img class=\"$style\" src=\"$name\"> </a></td></tr>\n";     
+      break;
+    default:
+      echo "<tr><td class=\"$style\"> <a class=\"$style\" href=\"$link\"> $name </a></td></tr>\n";     
+      break;
+    } 
+  }
+  fclose ($file);
+}
+
+function menu_end () { 
+  echo "</td></tr></table>\n";
+  echo "</body></html>\n\n";
+  exit ();
+}
+
+function dirlist ($source) {
+  if (!file_exists($source)) return;
+
+  $file = fopen ($source, "r");
+  if (!$file) return;
+
+  echo "<table class=\"dirlist\">\n";
+
+  // loop over the lines in the file and generate lines in the menu
+  while ($line = fgetcsv ($file, 1024, ":")) {
+    if (ereg ('^[:blank:]*#', $line[0])) continue;
+    if (count($line) < 2) continue;
+
+    // allows nested entries..
+    // if (count($line) == 2) {
+    //   $value = trim($line[0]);
+    //   if ($value == "input") {
+    //     $value = trim($line[1]);
+    //     menulines ($value, $root, $append, $project);
+    //   }
+    //   continue;
+    // }
+
+    if (count($line) != 5) continue;
+
+    $name  = trim($line[0]);
+    $link  = trim($line[1]);
+    $type  = trim($line[2]);
+    $style = trim($line[3]);
+    $info  = trim($line[4]);
+
+    switch ($type) { 
+    case 'plain':
+      echo "<tr class=\"$style\"><td>$name</td><td>$info</td></tr>\n";  
+      break;
+    case 'dir':
+      echo "<tr class=\"$style\"><td><a class=\"$style\" href=\"$link\">$name</a></td><td>$info</td></tr>\n";
+      break;
+    default:
+      echo "<tr class=\"$style\"><td><a class=\"$style\" href=\"$link\">$name</a></td><td>$info</td></tr>\n";
+      break;
+    } 
+  }
+  fclose ($file);
+  echo "</table>\n";
+}
+
+function verbatim ($source) {
+  if (!file_exists($source)) return;
+
+  $file = fopen ($source, "r");
+  if (!$file) return;
+
+  $addbreak = 0;
+
+  // loop over the lines in the file and generate lines in the menu
+  while ($line = fgets ($file, 1024)) {
+    if (strlen($line) < 2) {
+      if (!$addbreak) {
+	echo "<br>\n";
+      }
+      $addbreak = 1;
+      continue;
+    }
+    $Nc = strlen($line);
+    echo "$line\n";
+    $addbreak = 0;
+  } 
+  fclose ($file);
+}
+
+//////////////////////////////////////////////////////////////////////////
+// Return the value associated to the key (GET or POST method)
+// If convertKeyToHtmlkey is true, the key is converted to a 
+// so-called HTML, i.e. the key where '.' are replaced by '_'
+// (e.g. the conversion of 'f.o.o.b_a_r' is 'f_o_o_b_a_r'.
+//
+function get_value_from_key ($key, $convertKeyToHtmlkey) {
+  if ($convertKeyToHtmlkey) {
+    $htmlkey = preg_replace ('|\.|', '_', $key);
+  } else {
+    $htmlkey = $key;
+  }
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    return $_GET[$htmlkey]; 
+  } else {
+    return $_POST[$htmlkey]; 
+  }
+}
Index: trunk/ippData/utils/phptest.php
===================================================================
--- trunk/ippData/utils/phptest.php	(revision 33988)
+++ trunk/ippData/utils/phptest.php	(revision 33988)
@@ -0,0 +1,28 @@
+<?php 
+
+$utils = "/export/ipp002.0/www/localhost/utils";
+
+include "$utils/ipp.php";
+
+menu("$utils/ipp.menu.dat", 'test.page', $rootdir, "$rootdir/ipp.css", '', '');
+
+
+$varlist = array ('SERVER_NAME', 'GATEWAY_INTERFACE', 'SERVER_PROTOCOL',
+'SERVER_PORT', 'REQUEST_METHOD', 'PATH_INFO', 'PATH_TRANSLATED', 'SCRIPT_NAME',
+'QUERY_STRING', 'REMOTE_HOST', 'REMOTE_ADDR', 'AUTH_TYPE', 'REMOTE_USER',
+'REMOTE_IDENT', 'CONTENT_TYPE', 'CONTENT_LENGTH');
+
+foreach ($varlist as $name) {
+  echo "$name : $_SERVER[$name]<br>\n";
+}
+
+echo "get list<br>\n";
+foreach ($_GET as $key => $value) {
+  echo "$key : $value<br>\n";
+}
+
+$value = system ("ls /etc", $status);
+echo "status: $status\n";
+
+menu_end();
+?>
