#### Archived

This topic is now archived and is closed to further replies.

# cgi in c question

This topic is 5130 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have a cgi script(test.exe) coded in c. It gives out html code. I want to embed this html code into a website file called index.html. How can i do this. Example: I want sth. like this index.html: ...lots of html code.... insert output of test.exe here ...more htmls code... -CProgrammer

##### Share on other sites
Use a server side include. Don''t know if SSI''s work the same for all servers, but on Apache you do it like this.
<!--#include virtual="test.exe" -->

##### Share on other sites
Maybe im getting this wrong or maybe its cause im using IIS but i tryed just entering the line you gave me into the html where i want test.exe to add its html but that didnt work.
Thanks for the hint though i''ll try googling for this.

-CProgrammer

##### Share on other sites
I dont know IIS but try renaming your file to .shtml and changing
<!--#include virtual="test.exe" -->
to <!--#exec cgi="test.exe"-->

CGI in C.

/me shudders.

##### Share on other sites
quote:
Original post by CProgrammer
Maybe im getting this wrong or maybe its cause im using IIS but i tryed just entering the line you gave me into the html where i want test.exe to add its html but that didnt work.

In what way did it not work? Error? Is the include directive still in the file?

##### Share on other sites
Sarge voice:
"Why in HELL would you code a CGI in C? That doesn''t make a LICK OF SENSE!"

##### Share on other sites
quote:

I dont know IIS but try renaming your file to .shtml and changing
<!--#include virtual="test.exe" -->
to <!--#exec cgi="test.exe"-->

Thanks sark.

antareus and Arild Fines:
C/C++ is my preferred syntax, its what i programm the fastest in. Plus it gives me complete controll, there isnt much you cant do. Ive looked into php just recently and thats pretty good too, powerfull and keeping the Syntax. I dont much like the asp syntax. Seems to me php is the perfect solution for me, however it doesnt hurt to know how to integrate c, in case php wont do.

[edited by - CProgrammer on November 28, 2003 4:15:13 AM]

##### Share on other sites
quote:
Original post by CProgrammer
C/C++ is my preferred syntax, its what i programm the fastest in. Plus it gives me complete controll, there isnt much you cant do. Ive looked into php just recently and thats pretty good too, powerfull and keeping the Syntax. I dont much like the asp syntax. Seems to me php is the perfect solution for me, however it doesnt hurt to know how to integrate c, in case php wont do. 2003 4:15:13 AM]

First: CGI/Web programming is 70% text manipulation. Why then choose the language with the lousiest text manipulation support?

Second: CGI/Web programming is about providing a server thats publicly available on the internet. Why then choose the language that is the most vulnerable to buffer overflow exploits?

##### Share on other sites
quote:
Second: CGI/Web programming is about providing a server thats publicly available on the internet. Why then choose the language that is the most vulnerable to buffer overflow exploits?

You''ve got a point. I''m convinced.
-CProgrammer

• ### Forum Statistics

• Total Topics
628707
• Total Posts
2984312

• 23
• 10
• 9
• 13
• 14