Lighttpd trashes HTML header
Added by wymand about 10 years ago
OS Raspbian (Debian)
lighttpd/1.4.31 (ssl) - a light and fast webserver
Build-Date: Nov 17 2013 05:17:26
I have a Python script that produces a web page on the fly.
# -*- coding: utf-8 -*- import subprocess import os import sys sysVars = '<script type="text/javascript">' + chr(10) sysVars = sysVars + ' var xmlHttp = null;' + chr(10) #--------------------------------------------------------------------------- # NOTE! alhough I left room for it, I am not using the onload function #osRet = subprocess.getstatusoutput onloadscript = """<script type="text/javascript"> """ sysFunctions = """<script type="text/javascript"> function isNormalInteger(str) { var n = ~~Number(str); return String(n) === str && n >= 0; } """ qryStr = '0' if 'QUERY_STRING' in os.environ: qryStr = os.environ['QUERY_STRING'] else: qryStr = sys.argv[1] if qryStr != "" and qryStr.isdigit(): #NOTE!!! I am not checking to see if it is a valid camera number #===================================================== # Get all of the v4l2 parameters for the camera initCommand = 'sudo v4l2-ctl --device=/dev/video' + str(qryStr) + ' -l' cmdRet = subprocess.getoutput(initCommand) #--------------------------------------------------------------- # Find the card type try: parmStr = cmdRet bodyInsert = '<center><table style="border: medium outset #0000FF"><tr> <th colspan=2><b>Settings for Camera</b></th></tr>' + chr(10) for myLine in parmStr.split(chr(10)): myLine = myLine.lstrip() myVal = myLine.split(" ") if "(int)" in myLine: try: bodyInsert = bodyInsert + '<tr><td><center><input style="border: medium outset #0000FF" id="' + myVal[0] + 'plus" type="button" value="' \ + myVal[0] + '+" onclick=setplus' + myVal[0] + '() /></center></td>' + chr(10) \ + '<td rowspan=2 style="border: medium outset #0000FF"><input id="' + myVal[0] + 'val" type="text" value="' \ + myVal[10].split("=")[1] + '" style="text-align: center" /></td></tr>' + chr(10) \ + '<tr><td><center><input style="border: medium outset #0000FF" id="' + myVal[0] + 'minus" type="button" value="' \ + myVal[0] + '-" onclick=setminus' + myVal[0] + '() /></center></td>' + chr(10) #============================================================================================================================= sysVars = sysVars + " var loc" + myVal[0] + " = " + myVal[10].split("=")[1] +";" + chr(10) \ + " var locMax" + myVal[0] + " = " + myVal[7].split("=")[1] +";" + chr(10) \ + " var locMin" + myVal[0] + " = " + myVal[6].split("=")[1] +";" + chr(10) #============================================================================================================================= sysFunctions = sysFunctions + " function setplus" + myVal[0] + "() {" + chr(10) \ + ' if (loc' + myVal[0] + ' < locMax' + myVal[0] + ') {' + chr(10) \ + ' loc' + myVal[0] + ' = loc' + myVal[0] + ' + 1;' + chr(10) \ + " xmlHttp = new XMLHttpRequest();" + chr(10) \ + " var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video" + qryStr + " --set-ctrl=" + myVal[0] + "=' + loc" \ + myVal[0] + ";" + chr(10) + ' xmlHttp.open("GET", camCommand, false);' + chr(10) \ + ' xmlHttp.send(null);' + chr(10) \ + ' document.getElementById("' + myVal[0] + 'val").value=loc' + myVal[0] + ';' + chr(10) \ + ' }' + chr(10) + ' }' + chr(10) + chr(10) #============================================================================================================================= sysFunctions = sysFunctions + " function setminus" + myVal[0] + "() {" + chr(10) \ + ' if (loc' + myVal[0] + ' > locMin' + myVal[0] + ') {' + chr(10) \ + ' loc' + myVal[0] + ' = loc' + myVal[0] + ' - 1;' + chr(10) \ + " xmlHttp = new XMLHttpRequest();" + chr(10) \ + " var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video" + qryStr + " --set-ctrl=" + myVal[0] + "=' + loc" \ + myVal[0] + ";" + chr(10) + ' xmlHttp.open("GET", camCommand, false);' + chr(10) \ + ' xmlHttp.send(null);' + chr(10) \ + ' document.getElementById("' + myVal[0] + 'val").value=loc' + myVal[0] + ';' + chr(10) \ + ' }' + chr(10) + ' }' + chr(10) + chr(10) #============================================================================================================================= except Exception as e: bodyInsert = bodyInsert + str(e) finally: pass elif "(menu)" in myLine: try: bodyInsert = bodyInsert + '<tr><td><center><input style="border: medium inset #0000FF" id="' + myVal[0] + 'plus" type="button" value="' \ + myVal[0] + '+" onclick=setplus' + myVal[0] + '() /></center></td>' + chr(10) \ + '<td rowspan=2 style="border: medium inset #0000FF"><input id="' + myVal[0] + 'val" type="text" value="' \ + myVal[8].split("=")[1] + '" style="text-align: center" /></td></tr>' + chr(10) \ + '<tr><td><center><input style="border: medium inset #0000FF" id="' + myVal[0] + 'minus" type="button" value="' \ + myVal[0] + '-" onclick=setminus' + myVal[0] + '() /></center></td>' + chr(10) #============================================================================================================================= sysVars = sysVars + " var loc" + myVal[0] + " = " + myVal[8].split("=")[1] +";" + chr(10) \ + " var locMax" + myVal[0] + " = " + myVal[6].split("=")[1] +";" + chr(10) \ + " var locMin" + myVal[0] + " = " + myVal[5].split("=")[1] +";" + chr(10) #============================================================================================================================= sysFunctions = sysFunctions + " function setplus" + myVal[0] + "() {" + chr(10) \ + ' if (loc' + myVal[0] + ' < locMax' + myVal[0] + ') {' + chr(10) \ + ' loc' + myVal[0] + ' = loc' + myVal[0] + ' + 1;' + chr(10) \ + " xmlHttp = new XMLHttpRequest();" + chr(10) \ + " var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video" + qryStr + " --set-ctrl=" + myVal[0] + "=' + loc" \ + myVal[0] + ";" + chr(10) + ' xmlHttp.open("GET", camCommand, false);' + chr(10) \ + ' xmlHttp.send(null);' + chr(10) \ + ' document.getElementById("' + myVal[0] + 'val").value=loc' + myVal[0] + ';' + chr(10) \ + ' }' + chr(10) + ' }' + chr(10) + chr(10) #============================================================================================================================= sysFunctions = sysFunctions + " function setminus" + myVal[0] + "() {" + chr(10) \ + ' if (loc' + myVal[0] + ' > locMin' + myVal[0] + ') {' + chr(10) \ + ' loc' + myVal[0] + ' = loc' + myVal[0] + ' - 1;' + chr(10) \ + " xmlHttp = new XMLHttpRequest();" + chr(10) \ + " var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video" + qryStr + " --set-ctrl=" + myVal[0] + "=' + loc" \ + myVal[0] + ";" + chr(10) + ' xmlHttp.open("GET", camCommand, false);' + chr(10) \ + ' xmlHttp.send(null);' + chr(10) \ + ' document.getElementById("' + myVal[0] + 'val").value=loc' + myVal[0] + ';' + chr(10) \ + ' }' + chr(10) + ' }' + chr(10) + chr(10) #============================================================================================================================= except Exception as e: bodyInsert = bodyInsert + str(e) finally: pass elif "(bool)" in myLine: try: #============================================if boolean value is 0============================================================= if myVal[6].split("=")[1] == str(0): sysVars = sysVars + " var loc" + myVal[0] + " = 0" + chr(10) bodyInsert = bodyInsert + '<tr><td style="border: medium outset #0000FF"><center>' + myVal[0] + '</center></td>' + chr(10) + \ '<td style="border: medium outset #0000FF"><center>True<input id="' + myVal[0] + '" type="radio" value="' \ 'true" name="' + myVal[0] + '" onclick=setbool' + myVal[0] + '(1) />' + chr(10) + \ 'False<input id="' + myVal[0] + '" type="radio" value="' \ 'false" name="' + myVal[0] + '" onclick=setbool' + myVal[0] + '(0) checked /></center></td></tr>' + chr(10) #============================================if boolean value is 1============================================================ elif myVal[6].split("=")[1] == str(1): sysVars = sysVars + " var loc" + myVal[0] + " = 1" + chr(10) bodyInsert = bodyInsert + '<tr><td style="border: medium outset #0000FF"><center>' + myVal[0] + '</center></td>' + chr(10) + \ '<td style="border: medium outset #0000FF"><center>True<input id="' + myVal[0] + '" type="radio" value="' \ 'true" name="' + myVal[0] + '" onclick=setbool' + myVal[0] + '(1) checked />' + chr(10) + \ 'False<input id="' + myVal[0] + '" type="radio" value="' \ 'false" name="' + myVal[0] + '" onclick=setbool' + myVal[0] + '(0) /></center></td></tr>' + chr(10) #===========================================if boolean value is unknown================================================ else: sysVars = sysVars + " var loc" + myVal[0] + " = 2;" + chr(10) bodyInsert = bodyInsert + '<tr><td style="border: medium outset #0000FF"><center>' + myVal[0] + '</center></td>' + chr(10) + \ '<td style="border: medium outset #0000FF"><center>True<input id="' + myVal[0] + '" type="radio" value="' \ 'true" name="' + myVal[0] + '" onclick=setbool' + myVal[0] + '(1) /></center>' + chr(10) + \ '<center>False<input id="' + myVal[0] + '" type="radio" value="' \ 'false" name="' + myVal[0] + '" onclick=setbool' + myVal[0] + '(0) /></center></td></tr>' + chr(10) #============================================================================================================================= sysVars = sysVars + " var loc" + myVal[0] + " = " + myVal[6].split("=")[1] +";" + chr(10) #============================================================================================================================= sysFunctions = sysFunctions + " function setbool" + myVal[0] + "(locVal) {" + chr(10) \ + ' loc' + myVal[0] + ' = arguments[0];' + chr(10) \ + " xmlHttp = new XMLHttpRequest();" + chr(10) \ + " var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video" + qryStr + " --set-ctrl=" + myVal[0] + "=' + arguments[0];"+ chr(10) \ + ' xmlHttp.open("GET", camCommand, false);' + chr(10) \ + ' xmlHttp.send(null);' + chr(10) \ + ' }' + chr(10) + chr(10) + chr(10) #============================================================================================================================= except Exception as e: bodyInsert = bodyInsert + str(e) finally: pass except ValueError: bodyInsert = "Bad Camera number given ---" + qryStr else: bodyInsert = "The camera number must be numeric" bodyInsert = bodyInsert + '</table></center>' + chr(10) htmlFormat = """<html Content-Type:text/html; charset=UTF-8 > <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <Title>Camera Controls</Title> {sysVars} </script> {onloadscript} </script> {sysFunctions} </script> </head> <body> <p>{bodyInsert} </p> </body> </html> """ print(htmlFormat.format(**locals()))
The produced page looks like:
<html Content-Type:text/html; charset=UTF-8 > <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <Title>Camera Controls</Title> <script type="text/javascript"> var xmlHttp = null; var locbrightness = 131; var locMaxbrightness = 255; var locMinbrightness = 0; var loccontrast = 32; var locMaxcontrast = 255; var locMincontrast = 0; var locsaturation = 28; var locMaxsaturation = 255; var locMinsaturation = 0; var locwhite_balance_temperature_auto = 1 var locwhite_balance_temperature_auto = 1; var locgain = 64; var locMaxgain = 255; var locMingain = 0; var locpower_line_frequency = 1; var locMaxpower_line_frequency = 2; var locMinpower_line_frequency = 0; var locwhite_balance_temperature = 9760; var locMaxwhite_balance_temperature = 10000; var locMinwhite_balance_temperature = 0; var locsharpness = 191; var locMaxsharpness = 255; var locMinsharpness = 0; var locbacklight_compensation = 1; var locMaxbacklight_compensation = 1; var locMinbacklight_compensation = 0; var locexposure_auto = 3; var locMaxexposure_auto = 3; var locMinexposure_auto = 0; var locexposure_absolute = 305; var locMaxexposure_absolute = 10000; var locMinexposure_absolute = 1; var locexposure_auto_priority = 1 var locexposure_auto_priority = 1; var locpan_absolute = 0; var locMaxpan_absolute = 36000; var locMinpan_absolute = -36000; var loctilt_absolute = 0; var locMaxtilt_absolute = 36000; var locMintilt_absolute = -36000; var locprivacy = 0 var locprivacy = 0; </script> <script type="text/javascript"> </script> <script type="text/javascript"> function isNormalInteger(str) { var n = ~~Number(str); return String(n) === str && n >= 0; } function setplusbrightness() { if (locbrightness < locMaxbrightness) { locbrightness = locbrightness + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=brightness=' + locbrightness; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("brightnessval").value=locbrightness; } } function setminusbrightness() { if (locbrightness > locMinbrightness) { locbrightness = locbrightness - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=brightness=' + locbrightness; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("brightnessval").value=locbrightness; } } function setpluscontrast() { if (loccontrast < locMaxcontrast) { loccontrast = loccontrast + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=contrast=' + loccontrast; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("contrastval").value=loccontrast; } } function setminuscontrast() { if (loccontrast > locMincontrast) { loccontrast = loccontrast - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=contrast=' + loccontrast; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("contrastval").value=loccontrast; } } function setplussaturation() { if (locsaturation < locMaxsaturation) { locsaturation = locsaturation + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=saturation=' + locsaturation; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("saturationval").value=locsaturation; } } function setminussaturation() { if (locsaturation > locMinsaturation) { locsaturation = locsaturation - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=saturation=' + locsaturation; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("saturationval").value=locsaturation; } } function setboolwhite_balance_temperature_auto(locVal) { locwhite_balance_temperature_auto = arguments[0]; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=white_balance_temperature_auto=' + arguments[0]; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); } function setplusgain() { if (locgain < locMaxgain) { locgain = locgain + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=gain=' + locgain; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("gainval").value=locgain; } } function setminusgain() { if (locgain > locMingain) { locgain = locgain - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=gain=' + locgain; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("gainval").value=locgain; } } function setpluspower_line_frequency() { if (locpower_line_frequency < locMaxpower_line_frequency) { locpower_line_frequency = locpower_line_frequency + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=power_line_frequency=' + locpower_line_frequency; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("power_line_frequencyval").value=locpower_line_frequency; } } function setminuspower_line_frequency() { if (locpower_line_frequency > locMinpower_line_frequency) { locpower_line_frequency = locpower_line_frequency - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=power_line_frequency=' + locpower_line_frequency; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("power_line_frequencyval").value=locpower_line_frequency; } } function setpluswhite_balance_temperature() { if (locwhite_balance_temperature < locMaxwhite_balance_temperature) { locwhite_balance_temperature = locwhite_balance_temperature + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=white_balance_temperature=' + locwhite_balance_temperature; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("white_balance_temperatureval").value=locwhite_balance_temperature; } } function setminuswhite_balance_temperature() { if (locwhite_balance_temperature > locMinwhite_balance_temperature) { locwhite_balance_temperature = locwhite_balance_temperature - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=white_balance_temperature=' + locwhite_balance_temperature; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("white_balance_temperatureval").value=locwhite_balance_temperature; } } function setplussharpness() { if (locsharpness < locMaxsharpness) { locsharpness = locsharpness + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=sharpness=' + locsharpness; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("sharpnessval").value=locsharpness; } } function setminussharpness() { if (locsharpness > locMinsharpness) { locsharpness = locsharpness - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=sharpness=' + locsharpness; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("sharpnessval").value=locsharpness; } } function setplusbacklight_compensation() { if (locbacklight_compensation < locMaxbacklight_compensation) { locbacklight_compensation = locbacklight_compensation + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=backlight_compensation=' + locbacklight_compensation; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("backlight_compensationval").value=locbacklight_compensation; } } function setminusbacklight_compensation() { if (locbacklight_compensation > locMinbacklight_compensation) { locbacklight_compensation = locbacklight_compensation - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=backlight_compensation=' + locbacklight_compensation; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("backlight_compensationval").value=locbacklight_compensation; } } function setplusexposure_auto() { if (locexposure_auto < locMaxexposure_auto) { locexposure_auto = locexposure_auto + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=exposure_auto=' + locexposure_auto; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("exposure_autoval").value=locexposure_auto; } } function setminusexposure_auto() { if (locexposure_auto > locMinexposure_auto) { locexposure_auto = locexposure_auto - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=exposure_auto=' + locexposure_auto; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("exposure_autoval").value=locexposure_auto; } } function setplusexposure_absolute() { if (locexposure_absolute < locMaxexposure_absolute) { locexposure_absolute = locexposure_absolute + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=exposure_absolute=' + locexposure_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("exposure_absoluteval").value=locexposure_absolute; } } function setminusexposure_absolute() { if (locexposure_absolute > locMinexposure_absolute) { locexposure_absolute = locexposure_absolute - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=exposure_absolute=' + locexposure_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("exposure_absoluteval").value=locexposure_absolute; } } function setboolexposure_auto_priority(locVal) { locexposure_auto_priority = arguments[0]; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=exposure_auto_priority=' + arguments[0]; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); } function setpluspan_absolute() { if (locpan_absolute < locMaxpan_absolute) { locpan_absolute = locpan_absolute + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=pan_absolute=' + locpan_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("pan_absoluteval").value=locpan_absolute; } } function setminuspan_absolute() { if (locpan_absolute > locMinpan_absolute) { locpan_absolute = locpan_absolute - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=pan_absolute=' + locpan_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("pan_absoluteval").value=locpan_absolute; } } function setplustilt_absolute() { if (loctilt_absolute < locMaxtilt_absolute) { loctilt_absolute = loctilt_absolute + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=tilt_absolute=' + loctilt_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("tilt_absoluteval").value=loctilt_absolute; } } function setminustilt_absolute() { if (loctilt_absolute > locMintilt_absolute) { loctilt_absolute = loctilt_absolute - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=tilt_absolute=' + loctilt_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("tilt_absoluteval").value=loctilt_absolute; } } function setboolprivacy(locVal) { locprivacy = arguments[0]; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video0 --set-ctrl=privacy=' + arguments[0]; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); } </script> </head> <body> <p><center><table style="border: medium outset #0000FF"><tr> <th colspan=2><b>Settings for Camera</b></th></tr> <tr><td><center><input style="border: medium outset #0000FF" id="brightnessplus" type="button" value="brightness+" onclick=setplusbrightness() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="brightnessval" type="text" value="131" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="brightnessminus" type="button" value="brightness-" onclick=setminusbrightness() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="contrastplus" type="button" value="contrast+" onclick=setpluscontrast() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="contrastval" type="text" value="32" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="contrastminus" type="button" value="contrast-" onclick=setminuscontrast() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="saturationplus" type="button" value="saturation+" onclick=setplussaturation() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="saturationval" type="text" value="28" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="saturationminus" type="button" value="saturation-" onclick=setminussaturation() /></center></td> <tr><td style="border: medium outset #0000FF"><center>white_balance_temperature_auto</center></td> <td style="border: medium outset #0000FF"><center>True<input id="white_balance_temperature_auto" type="radio" value="true" name="white_balance_temperature_auto" onclick=setboolwhite_balance_temperature_auto(1) checked /> False<input id="white_balance_temperature_auto" type="radio" value="false" name="white_balance_temperature_auto" onclick=setboolwhite_balance_temperature_auto(0) /></center></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="gainplus" type="button" value="gain+" onclick=setplusgain() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="gainval" type="text" value="64" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="gainminus" type="button" value="gain-" onclick=setminusgain() /></center></td> <tr><td><center><input style="border: medium inset #0000FF" id="power_line_frequencyplus" type="button" value="power_line_frequency+" onclick=setpluspower_line_frequency() /></center></td> <td rowspan=2 style="border: medium inset #0000FF"><input id="power_line_frequencyval" type="text" value="1" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium inset #0000FF" id="power_line_frequencyminus" type="button" value="power_line_frequency-" onclick=setminuspower_line_frequency() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="white_balance_temperatureplus" type="button" value="white_balance_temperature+" onclick=setpluswhite_balance_temperature() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="white_balance_temperatureval" type="text" value="9760" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="white_balance_temperatureminus" type="button" value="white_balance_temperature-" onclick=setminuswhite_balance_temperature() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="sharpnessplus" type="button" value="sharpness+" onclick=setplussharpness() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="sharpnessval" type="text" value="191" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="sharpnessminus" type="button" value="sharpness-" onclick=setminussharpness() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="backlight_compensationplus" type="button" value="backlight_compensation+" onclick=setplusbacklight_compensation() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="backlight_compensationval" type="text" value="1" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="backlight_compensationminus" type="button" value="backlight_compensation-" onclick=setminusbacklight_compensation() /></center></td> <tr><td><center><input style="border: medium inset #0000FF" id="exposure_autoplus" type="button" value="exposure_auto+" onclick=setplusexposure_auto() /></center></td> <td rowspan=2 style="border: medium inset #0000FF"><input id="exposure_autoval" type="text" value="3" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium inset #0000FF" id="exposure_autominus" type="button" value="exposure_auto-" onclick=setminusexposure_auto() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="exposure_absoluteplus" type="button" value="exposure_absolute+" onclick=setplusexposure_absolute() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="exposure_absoluteval" type="text" value="305" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="exposure_absoluteminus" type="button" value="exposure_absolute-" onclick=setminusexposure_absolute() /></center></td> <tr><td style="border: medium outset #0000FF"><center>exposure_auto_priority</center></td> <td style="border: medium outset #0000FF"><center>True<input id="exposure_auto_priority" type="radio" value="true" name="exposure_auto_priority" onclick=setboolexposure_auto_priority(1) checked /> False<input id="exposure_auto_priority" type="radio" value="false" name="exposure_auto_priority" onclick=setboolexposure_auto_priority(0) /></center></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="pan_absoluteplus" type="button" value="pan_absolute+" onclick=setpluspan_absolute() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="pan_absoluteval" type="text" value="0" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="pan_absoluteminus" type="button" value="pan_absolute-" onclick=setminuspan_absolute() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="tilt_absoluteplus" type="button" value="tilt_absolute+" onclick=setplustilt_absolute() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="tilt_absoluteval" type="text" value="0" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="tilt_absoluteminus" type="button" value="tilt_absolute-" onclick=setminustilt_absolute() /></center></td> <tr><td style="border: medium outset #0000FF"><center>privacy</center></td> <td style="border: medium outset #0000FF"><center>True<input id="privacy" type="radio" value="true" name="privacy" onclick=setboolprivacy(1) /> False<input id="privacy" type="radio" value="false" name="privacy" onclick=setboolprivacy(0) checked /></center></td></tr> </table></center> </p> </body> </html>
When it is returned by Lighty it is changed to:
</script> <script type="text/javascript"> </script> <script type="text/javascript"> function isNormalInteger(str) { var n = ~~Number(str); return String(n) === str && n >= 0; } function setplusbrightness() { if (locbrightness < locMaxbrightness) { locbrightness = locbrightness + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=brightness=' + locbrightness; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("brightnessval").value=locbrightness; } } function setminusbrightness() { if (locbrightness > locMinbrightness) { locbrightness = locbrightness - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=brightness=' + locbrightness; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("brightnessval").value=locbrightness; } } function setpluscontrast() { if (loccontrast < locMaxcontrast) { loccontrast = loccontrast + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=contrast=' + loccontrast; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("contrastval").value=loccontrast; } } function setminuscontrast() { if (loccontrast > locMincontrast) { loccontrast = loccontrast - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=contrast=' + loccontrast; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("contrastval").value=loccontrast; } } function setplussaturation() { if (locsaturation < locMaxsaturation) { locsaturation = locsaturation + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=saturation=' + locsaturation; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("saturationval").value=locsaturation; } } function setminussaturation() { if (locsaturation > locMinsaturation) { locsaturation = locsaturation - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=saturation=' + locsaturation; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("saturationval").value=locsaturation; } } function setboolwhite_balance_temperature_auto(locVal) { locwhite_balance_temperature_auto = arguments[0]; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=white_balance_temperature_auto=' + arguments[0]; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); } function setpluspower_line_frequency() { if (locpower_line_frequency < locMaxpower_line_frequency) { locpower_line_frequency = locpower_line_frequency + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=power_line_frequency=' + locpower_line_frequency; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("power_line_frequencyval").value=locpower_line_frequency; } } function setminuspower_line_frequency() { if (locpower_line_frequency > locMinpower_line_frequency) { locpower_line_frequency = locpower_line_frequency - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=power_line_frequency=' + locpower_line_frequency; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("power_line_frequencyval").value=locpower_line_frequency; } } function setpluswhite_balance_temperature() { if (locwhite_balance_temperature < locMaxwhite_balance_temperature) { locwhite_balance_temperature = locwhite_balance_temperature + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=white_balance_temperature=' + locwhite_balance_temperature; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("white_balance_temperatureval").value=locwhite_balance_temperature; } } function setminuswhite_balance_temperature() { if (locwhite_balance_temperature > locMinwhite_balance_temperature) { locwhite_balance_temperature = locwhite_balance_temperature - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=white_balance_temperature=' + locwhite_balance_temperature; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("white_balance_temperatureval").value=locwhite_balance_temperature; } } function setplussharpness() { if (locsharpness < locMaxsharpness) { locsharpness = locsharpness + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=sharpness=' + locsharpness; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("sharpnessval").value=locsharpness; } } function setminussharpness() { if (locsharpness > locMinsharpness) { locsharpness = locsharpness - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=sharpness=' + locsharpness; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("sharpnessval").value=locsharpness; } } function setplusbacklight_compensation() { if (locbacklight_compensation < locMaxbacklight_compensation) { locbacklight_compensation = locbacklight_compensation + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=backlight_compensation=' + locbacklight_compensation; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("backlight_compensationval").value=locbacklight_compensation; } } function setminusbacklight_compensation() { if (locbacklight_compensation > locMinbacklight_compensation) { locbacklight_compensation = locbacklight_compensation - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=backlight_compensation=' + locbacklight_compensation; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("backlight_compensationval").value=locbacklight_compensation; } } function setplusexposure_auto() { if (locexposure_auto < locMaxexposure_auto) { locexposure_auto = locexposure_auto + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=exposure_auto=' + locexposure_auto; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("exposure_autoval").value=locexposure_auto; } } function setminusexposure_auto() { if (locexposure_auto > locMinexposure_auto) { locexposure_auto = locexposure_auto - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=exposure_auto=' + locexposure_auto; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("exposure_autoval").value=locexposure_auto; } } function setplusexposure_absolute() { if (locexposure_absolute < locMaxexposure_absolute) { locexposure_absolute = locexposure_absolute + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=exposure_absolute=' + locexposure_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("exposure_absoluteval").value=locexposure_absolute; } } function setminusexposure_absolute() { if (locexposure_absolute > locMinexposure_absolute) { locexposure_absolute = locexposure_absolute - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=exposure_absolute=' + locexposure_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("exposure_absoluteval").value=locexposure_absolute; } } function setpluspan_absolute() { if (locpan_absolute < locMaxpan_absolute) { locpan_absolute = locpan_absolute + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=pan_absolute=' + locpan_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("pan_absoluteval").value=locpan_absolute; } } function setminuspan_absolute() { if (locpan_absolute > locMinpan_absolute) { locpan_absolute = locpan_absolute - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=pan_absolute=' + locpan_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("pan_absoluteval").value=locpan_absolute; } } function setplustilt_absolute() { if (loctilt_absolute < locMaxtilt_absolute) { loctilt_absolute = loctilt_absolute + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=tilt_absolute=' + loctilt_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("tilt_absoluteval").value=loctilt_absolute; } } function setminustilt_absolute() { if (loctilt_absolute > locMintilt_absolute) { loctilt_absolute = loctilt_absolute - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=tilt_absolute=' + loctilt_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("tilt_absoluteval").value=loctilt_absolute; } } function setplusfocus_absolute() { if (locfocus_absolute < locMaxfocus_absolute) { locfocus_absolute = locfocus_absolute + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=focus_absolute=' + locfocus_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("focus_absoluteval").value=locfocus_absolute; } } function setminusfocus_absolute() { if (locfocus_absolute > locMinfocus_absolute) { locfocus_absolute = locfocus_absolute - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=focus_absolute=' + locfocus_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("focus_absoluteval").value=locfocus_absolute; } } function setboolfocus_auto(locVal) { locfocus_auto = arguments[0]; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=focus_auto=' + arguments[0]; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); } function setpluszoom_absolute() { if (loczoom_absolute < locMaxzoom_absolute) { loczoom_absolute = loczoom_absolute + 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=zoom_absolute=' + loczoom_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("zoom_absoluteval").value=loczoom_absolute; } } function setminuszoom_absolute() { if (loczoom_absolute > locMinzoom_absolute) { loczoom_absolute = loczoom_absolute - 1; xmlHttp = new XMLHttpRequest(); var camCommand = 'http://192.168.0.151/www/myv4.py? --device=/dev/video2 --set-ctrl=zoom_absolute=' + loczoom_absolute; xmlHttp.open("GET", camCommand, false); xmlHttp.send(null); document.getElementById("zoom_absoluteval").value=loczoom_absolute; } } </script> </head> <body> <p><center><table style="border: medium outset #0000FF"><tr> <th colspan=2><b>Settings for Camera</b></th></tr> <tr><td><center><input style="border: medium outset #0000FF" id="brightnessplus" type="button" value="brightness+" onclick=setplusbrightness() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="brightnessval" type="text" value="71" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="brightnessminus" type="button" value="brightness-" onclick=setminusbrightness() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="contrastplus" type="button" value="contrast+" onclick=setpluscontrast() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="contrastval" type="text" value="10" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="contrastminus" type="button" value="contrast-" onclick=setminuscontrast() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="saturationplus" type="button" value="saturation+" onclick=setplussaturation() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="saturationval" type="text" value="62" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="saturationminus" type="button" value="saturation-" onclick=setminussaturation() /></center></td> <tr><td style="border: medium outset #0000FF"><center>white_balance_temperature_auto</center></td> <td style="border: medium outset #0000FF"><center>True<input id="white_balance_temperature_auto" type="radio" value="true" name="white_balance_temperature_auto" onclick=setboolwhite_balance_temperature_auto(1) checked /> False<input id="white_balance_temperature_auto" type="radio" value="false" name="white_balance_temperature_auto" onclick=setboolwhite_balance_temperature_auto(0) /></center></td></tr> <tr><td><center><input style="border: medium inset #0000FF" id="power_line_frequencyplus" type="button" value="power_line_frequency+" onclick=setpluspower_line_frequency() /></center></td> <td rowspan=2 style="border: medium inset #0000FF"><input id="power_line_frequencyval" type="text" value="2" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium inset #0000FF" id="power_line_frequencyminus" type="button" value="power_line_frequency-" onclick=setminuspower_line_frequency() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="white_balance_temperatureplus" type="button" value="white_balance_temperature+" onclick=setpluswhite_balance_temperature() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="white_balance_temperatureval" type="text" value="6928" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="white_balance_temperatureminus" type="button" value="white_balance_temperature-" onclick=setminuswhite_balance_temperature() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="sharpnessplus" type="button" value="sharpness+" onclick=setplussharpness() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="sharpnessval" type="text" value="25" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="sharpnessminus" type="button" value="sharpness-" onclick=setminussharpness() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="backlight_compensationplus" type="button" value="backlight_compensation+" onclick=setplusbacklight_compensation() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="backlight_compensationval" type="text" value="3" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="backlight_compensationminus" type="button" value="backlight_compensation-" onclick=setminusbacklight_compensation() /></center></td> <tr><td><center><input style="border: medium inset #0000FF" id="exposure_autoplus" type="button" value="exposure_auto+" onclick=setplusexposure_auto() /></center></td> <td rowspan=2 style="border: medium inset #0000FF"><input id="exposure_autoval" type="text" value="3" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium inset #0000FF" id="exposure_autominus" type="button" value="exposure_auto-" onclick=setminusexposure_auto() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="exposure_absoluteplus" type="button" value="exposure_absolute+" onclick=setplusexposure_absolute() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="exposure_absoluteval" type="text" value="156" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="exposure_absoluteminus" type="button" value="exposure_absolute-" onclick=setminusexposure_absolute() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="pan_absoluteplus" type="button" value="pan_absolute+" onclick=setpluspan_absolute() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="pan_absoluteval" type="text" value="0" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="pan_absoluteminus" type="button" value="pan_absolute-" onclick=setminuspan_absolute() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="tilt_absoluteplus" type="button" value="tilt_absolute+" onclick=setplustilt_absolute() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="tilt_absoluteval" type="text" value="0" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="tilt_absoluteminus" type="button" value="tilt_absolute-" onclick=setminustilt_absolute() /></center></td> <tr><td><center><input style="border: medium outset #0000FF" id="focus_absoluteplus" type="button" value="focus_absolute+" onclick=setplusfocus_absolute() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="focus_absoluteval" type="text" value="14" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="focus_absoluteminus" type="button" value="focus_absolute-" onclick=setminusfocus_absolute() /></center></td> <tr><td style="border: medium outset #0000FF"><center>focus_auto</center></td> <td style="border: medium outset #0000FF"><center>True<input id="focus_auto" type="radio" value="true" name="focus_auto" onclick=setboolfocus_auto(1) checked /> False<input id="focus_auto" type="radio" value="false" name="focus_auto" onclick=setboolfocus_auto(0) /></center></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="zoom_absoluteplus" type="button" value="zoom_absolute+" onclick=setpluszoom_absolute() /></center></td> <td rowspan=2 style="border: medium outset #0000FF"><input id="zoom_absoluteval" type="text" value="0" style="text-align: center" /></td></tr> <tr><td><center><input style="border: medium outset #0000FF" id="zoom_absoluteminus" type="button" value="zoom_absolute-" onclick=setminuszoom_absolute() /></center></td> </table></center> </p> </body> </html>
How can I stop Lighty from trashing the page??? Yes, I am new to lighttpd but have searched for the answer all over with no luck
Thank you all in advance
Doug Wyman
Replies (3)
RE: Lighttpd trashes HTML header - Added by wymand about 10 years ago
Sorry for the long unreadable post, the "code" marker did not create a scrolling code window as I hoped.
RE: Lighttpd trashes HTML header - Added by stbuehler about 10 years ago
If your first line contains a colon, lighttpd expects a full HTTP header (which you should generate in any case).
The first empty line ends that header.
RE: Lighttpd trashes HTML header - Added by wymand about 10 years ago
WONDERFUL!!!!
I copied the "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">" header that
Lighttpd added to my code and it all works fine!!!!
Thank you very much for the reply. This solves a number of problems.
Doug Wyman