Skip to main content
GameDev.net gamedev.net
🔒 Locked

cgi in c question

Started by CProgrammer Nov 27, 2003 at 2:57 AM 8 replies 1.5k views
Original Post
CProgrammer
CProgrammer
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
Brother Bob
Brother Bob
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" -->
CProgrammer
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.
Thanks for the hint though i''ll try googling for this.

-CProgrammer
sark
sark
I dont know IIS but try renaming your file to .shtml and changing
<!--#include virtual="test.exe" -->
to <!--#exec cgi="test.exe"-->
Brother Bob
Brother Bob
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?
antareus
antareus
Sarge voice:
"Why in HELL would you code a CGI in C? That doesn''t make a LICK OF SENSE!"
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
CProgrammer
CProgrammer
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]
Arild Fines
Arild Fines
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?
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
CProgrammer
CProgrammer
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.