c on webpage

Discussion in 'Programming' started by promotingspace.net, Nov 4, 2008.

  1. #1
    Hi
    what is required to execute a c script and show result in a webpage?
     
    promotingspace.net, Nov 4, 2008 IP
  2. ZenOswyn

    ZenOswyn Peon

    Messages:
    50
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Technically, c is not a scripting language, but a compiled language. So you'd need to compile it first and then you can put it on a web page.

    There are a couple of ways to do it. You could call the compiled program through the PHP function exec(), or you could just run the program through CGI--see this page for examples of how to do so.

    http://www.cs.tut.fi/~jkorpela/forms/cgic.html

    Just a quick note: if you're on a shared host, chances are they don't support the use of gcc due to security reasons.
     
    ZenOswyn, Nov 4, 2008 IP
  3. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #3
    Barti1987, Nov 4, 2008 IP
  4. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #4
    You can do it via cgi .
     
    it career, Nov 5, 2008 IP