Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

C++ and Html?

  • 23-02-2010 11:48AM
    #1
    Registered Users, Registered Users 2 Posts: 2,110 ✭✭✭


    Hi guys,
    Im programming an eCog1x cyan embedded system. Its done through C++.
    I can input and save a variable "Voltage". The board also has an onboard
    webserver which can display a web page. It doesn not Support PHP. Can anyone explain how I can display this variable on the html page. Cgi? Javascript?

    Any help is greatly appreciated


    Dave


Comments

  • Registered Users, Registered Users 2 Posts: 68,173 ✭✭✭✭seamus


    What webserver is running on the system?

    CGI would be the man for this, Perl would be the easiest, but you can use C or C++ (in some cases).


  • Registered Users, Registered Users 2 Posts: 2,110 ✭✭✭sei046


    Thanks so much for reply.
    Its this
    http://www.sics.se/~adam/old-uip/uip-1.0-refman/

    I just dont understand how to get a variable from c to html.
    Throughout this webserver there is dynamic content, and from what I see it has
    something like

    %!/Header ......

    Then later


    Net Statistics = %! net-stats

    So somehow the C is outputting to the header or something and this is been referenced in the html.


  • Registered Users, Registered Users 2 Posts: 68,173 ✭✭✭✭seamus


    It's running Apache 2.2.6, so it's not an old webserver.

    What you're describing looks like some kind of directive, though I don't know enough about Apache to say. Basically it looks like the "%!" operator is something which tells Apache to fetch information from a script or to run a script.


  • Registered Users, Registered Users 2 Posts: 2,110 ✭✭✭sei046


    So lets say I have a file system.
    In my main function I have a loop which constantly updates a variabel Voltage.
    How do I get this variable displayed on a webpage. Even statically for now. but ultimately
    in real time.

    Any ideas? Cgi?


  • Closed Accounts Posts: 43 oneintotwo


    Easiest, safest, simplest way is a database.

    Get the C software to connect to the MySQL server (there are libraries available to do this) and update the database with the new value.

    Use PHP/MySQL on web server. Write a PHP script to grab the value from the database and print it on the web page.


  • Advertisement
Advertisement