Thread: CGI in C

  1. #1
    Registered User dune911's Avatar
    Join Date
    Sep 2001
    Posts
    140

    CGI in C

    Hi, I just uploaded the following file to my webserver:
    http://www.packetst0rm.org/~dune/cgi-bin/sayhi.cgi
    When I try to start the file my IE only shows the source...

    Can anyone tell me why this happens?
    I wrote the script in MSVC++6 and just saved it as *.cgi without
    any compiling or such. Is this the right way or have I forgot something?

    Either the directory 'cgi-bin' and the file itself have CHMOD 777.

    Thanks for help!

  2. #2
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    cgi in C is compiled applications
    hello, internet!

  3. #3
    Registered User dune911's Avatar
    Join Date
    Sep 2001
    Posts
    140
    Really? Someone told me that I just have to upload the *.cgi
    I will ask my provider what I have to do to run my CGIs there...
    Thank you!

  4. #4
    Registered User
    Join Date
    May 2002
    Posts
    132
    I know that this is a post from a very long time ago, but I am replying to clarify on this matter incase someone else does a search on this board for this exact problem or just wants to know how to do it.

    You have to actually upload your .c file to the computer in which your webserver is being run on. Mainly because most development will be done on a windows based system and a compilation of your software there will not allow it to run on a unix based system (which is the most used OS when it comes to running online servers). So you upload your .c file to the computer it will be run on, and then you compile it. (Most likely through a shell account, but contact you webhost just to make sure. They can provide you with not only the account to compile it but also with the command to type in, in order to compile it incase your not familiar with these types of systems.) Then transfer the resulting executable file to your proper directory (also this command can be gotten from your webhost if your not familiar with these systems), most of the time your going into your directory (for your website) and looking for a \cgi-bin\ directory.

    Hope this helps!
    Tyouk

  5. #5
    Registered User dune911's Avatar
    Join Date
    Sep 2001
    Posts
    140
    >> Hope this helps!

    Yes, indeed! Thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. CGI program help please
    By Lince in forum C Programming
    Replies: 3
    Last Post: 08-01-2007, 01:31 AM
  2. cgi - c++ returns image
    By terracota in forum C++ Programming
    Replies: 1
    Last Post: 08-04-2004, 09:41 PM
  3. testing a cgi script on my computer
    By Bigbio2002 in forum C Programming
    Replies: 1
    Last Post: 12-14-2003, 07:26 PM
  4. CGI Mailing
    By sean in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 04-14-2003, 09:56 PM
  5. Problem with cgi script - can't rename files
    By bjdea1 in forum C Programming
    Replies: 2
    Last Post: 12-12-2001, 04:09 PM