Code: Select all
"&(varnaamvoorflash)=" & waarde
formaat waarde gewerkt wordt. Als er ook maar een vreemd teken voor of tussen staan gaat de boel onderuit en krijg je url encoded rommel en zelfs een deel van je eigen onload functie binnen.
(dit is het nieuwe scriptje waarmee ik wel een status terug krijg in flash)
<%@ Language=VBScript %>
<%
'Sorry for this, but i just got to thank these people for sharing the knowledgement online... So I could copy and paste this together. 'Esteban ,Jon00 and Lee Brimelow and all on domoticaforum.eu
'def. of vars that are used in asp file
Dim device, strType, devStatus
' devices get readed from vars posted to hsflash.asp?strType=XXXX&Device=XX (strType is for later on usage)
device = Request.Form("device")
strType = Request.Form("strType")
' get status from hs device variable
devStatus = hs.DeviceStatus([device])
'write the response to a for flash readable format. fieldnames have to start with &sign
'and can be loaded from the var name wich is sended back to flash.
'
'Example of flash code ( see complete method for action script ) this is only to make clear how the vars are parssed!
'
'ToHomeseer.sendAndLoad(submitURL,FromHomeseer, "POST");
'in this case the vars wil be avail. thru FromHomeseer.device, FromHomeseer.strType
'
response.write "&device=" & device
response.write "&strType=" & strType
response.write "&devStatus=" & devStatus
If device <> "" And Request.ServerVariables("AUTH_USER") <> "guest" Then
if strType = "light" then
If devStatus = 2 Then
hs.ExecX10 device,"Off"
Elseif devStatus = 3 Then
hs.ExecX10 device,"On"
Elseif devStatus = 4 Then
hs.ExecX10 device,"Off"
Elseif devStatus = 17 Then
hs.ExecX10 device,"ON"
End If
end if
End If
%>