Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Webserver: Showing a variable the simplest way

  1. #1
    Join Date
    Jul 2001
    Location
    Risør - Norway
    Posts
    5,477

    Default Webserver: Showing a variable the simplest way

    I would like to be able to see the status of some variables when logging into the Webserver. For instance the variable Varmepumpe.GirderTemp, which shows the temperature setting of my HVAC heat pump. Can somebody please tell me how to do that in the simplest way - only text, no fancy stuff, in a way that when I change the temp with my PPC (no Ajax, then) the temp variable will change as well?
    Tor - managing director of the Cinema Inferno home theater and multi-zone sound system with Girder running the show in the back, NetRemote as the GUI and Media Center 17, PowerDVD and ZoomPlayer as playback software
    Hobsyssel mastiffs: http://www.hobsyssel.no

  2. #2
    Join Date
    May 2003
    Location
    Stockholm, Sweden
    Posts
    446

    Default

    With the G3.3 HTTPd plugin you could execute lua with <% [script] %>, so you would just do something like:

    Code:
    Heatpump temperature&#58; <%=Varmepumpe.GirderTemp %>
    but it doesn't seem to work with the Webserver plugin for G4. Perhaps Ron can shed some light?? No lua seems to work with the webserver plugin, I tried the return example in the help file:

    <% local a = 10; a = a + 5; return a; %>

    Cheers,
    Jens

  3. #3
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,553

    Default

    use either

    Code:
    <%
    
     a = 10
     webserver&#58;print&#40; a &#41;
    
    %>
    or

    Code:
    <%
    
      a = 10
      return a
    
    %>
    The old way of doing this with the <%= is no longer supported. Have a look at the manual, if it is not clear please post that in the thread at the top of the forum about the manual.
    Ron
    No support through PM

  4. #4
    Join Date
    Jul 2001
    Location
    Risør - Norway
    Posts
    5,477

    Default

    Thanks, Ron! I'll try that.
    Tor - managing director of the Cinema Inferno home theater and multi-zone sound system with Girder running the show in the back, NetRemote as the GUI and Media Center 17, PowerDVD and ZoomPlayer as playback software
    Hobsyssel mastiffs: http://www.hobsyssel.no

  5. #5
    Join Date
    May 2003
    Location
    Stockholm, Sweden
    Posts
    446

    Default

    Thanks Ron,

    saw that in the help file, just didn't get it before I saw your example.. And then I saw the included example web you included, VERY NICE!!!! :lol:

  6. #6
    Join Date
    Jul 2001
    Location
    Risør - Norway
    Posts
    5,477

    Default

    As always I'm amazed at how thick my skull is... I can't get it working. Here's what I have in my HTML now, one feedback from this thread, the other one a direct copy from the help file:

    Code:
    <html> 
     <head> 
       <title>Girder-styring</title> 
      <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
     </head> 
     <body> 
      <h1>Girder-styring</h1> 
       24
     
       CID-test
    
    
    <% 
    
      a = 10 
      return a 
    
    %>
    <% local a = 10; a = a + 5; return a; %>
     </body> 
    </html>
    And I see nothing. ops: :cry: Only the events I have at the beginning of the script.
    Tor - managing director of the Cinema Inferno home theater and multi-zone sound system with Girder running the show in the back, NetRemote as the GUI and Media Center 17, PowerDVD and ZoomPlayer as playback software
    Hobsyssel mastiffs: http://www.hobsyssel.no

  7. #7
    Join Date
    May 2003
    Location
    Stockholm, Sweden
    Posts
    446

    Default

    Hey Tor,

    could be the same thing I did.. I named the file index.html, while it must be index.lhtml for this to work!! That is a small L, not a capital i in front of html.. :wink:

    //Jens

  8. #8
    Join Date
    Jul 2001
    Location
    Risør - Norway
    Posts
    5,477

    Default

    Isn't it kind of boring to be right all the time? :wink: Thanks! Works like a charm!
    Tor - managing director of the Cinema Inferno home theater and multi-zone sound system with Girder running the show in the back, NetRemote as the GUI and Media Center 17, PowerDVD and ZoomPlayer as playback software
    Hobsyssel mastiffs: http://www.hobsyssel.no

  9. #9
    Join Date
    May 2003
    Location
    Stockholm, Sweden
    Posts
    446

    Default

    haha, I don't know about that, I'm sure Ron and Mike are getting tired of all my slip-ups and stupid questions by now!!! :wink:

  10. #10
    Join Date
    Jul 2001
    Location
    Risør - Norway
    Posts
    5,477

    Default

    Not half as tired as they are of my eternal nagging, begging and obscure bugs, believe me! :lol:
    Tor - managing director of the Cinema Inferno home theater and multi-zone sound system with Girder running the show in the back, NetRemote as the GUI and Media Center 17, PowerDVD and ZoomPlayer as playback software
    Hobsyssel mastiffs: http://www.hobsyssel.no

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •