[Gambas-user] gb.web

Bruce bbruen at ...2308...
Fri Feb 22 02:36:00 CET 2013


On Thu, 2013-02-21 at 16:53 -0800, Mike Crean wrote:
> Hi Jussi,
> 
> Thanks for the reply.
> I have tried the example you have pointed to and can not get it to
> work.
> All I need to do is take data from a serial stream e.g.
> Stuff = "A01 ON" and use the print statement to display
> the
> string A01 ON on a HTML web page. I have Apache running ok and
> can display an index.html page from /var/www
> when I connect to
> http://localhost/
> I have tried entering this code in the
> index.html file, I don't get the desired result as it just displays
> the text and not the 
> print statement as such, it displays all
> the file <% and %> etc.
> 
> <html>
> <body>
> 
> <h1>Gambas3
> Web Server.</h1>
> <%
> print Stuff
> or print "A01
> ON"
> %>
> 
> </body>
> </html>
> 
> Mike

Have you included the "magic" line at the top? If not, the server will
just send the text of the file as is.
        
        #!/bin/env /usr/bin/gbw3
        
        <html>
        
        <h1>Gambas3 Web Server.</h1>
        
        <%
        print "A01 ON"
        %>
        
        </html>

works fine here.

hth
Bruce





More information about the User mailing list