Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

C++ and Html?

Options
  • 23-02-2010 11:48am
    #1
    Registered Users 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 Posts: 68,317 ✭✭✭✭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 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 Posts: 68,317 ✭✭✭✭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 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