Closed Thread Icon

Preserved Topic: use C++ for CGI Pages that link to <a href="https://ozoneasylum.com/backlink?for=21015" title="Pages that link to Preserved Topic: use C++ for CGI" rel="nofollow" >Preserved Topic: use C++ for CGI\

 
Author Thread
silence
Maniac (V) Inmate

From: soon to be "the land down under"
Insane since: Jan 2001

posted posted 03-06-2002 23:50

How can I use c++ for CGI? What do I need and how do I set it up?

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 03-07-2002 07:23

http://www.google.com/search?hl=en&q=programming+CGI+in+C%2B%2B


silence
Maniac (V) Inmate

From: soon to be "the land down under"
Insane since: Jan 2001

posted posted 03-08-2002 23:12

Thanks, max. Shoulda tried google first.

I have another problem.

I'm trying to get the length for the environment variable but I keep getting a segmentation fault. Here's the code:

code:
main()
{
const char *length1 = getenv("CONTENT_LENGTH");

cout << *length1;
}




lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 03-10-2002 20:33
quote:
const char *length1 = getenv("CONTENT_LENGTH");



ouch!

are you sure that "CONTENT_LENGTH" is set? if not and is returning a NULL, then trying to read from that address will crash your program.

try printf() , i remember it prints a string of it exists, or a NULL if a null pointer was provided.

printf("%s\n", length1);

gl,

silence
Maniac (V) Inmate

From: soon to be "the land down under"
Insane since: Jan 2001

posted posted 03-11-2002 22:45

Thanks, lallous. Yeah, it was trying to read a NULL address. So how do I check if CONTENT_LENGTH is set, or set it?

« BackwardsOnwards »

Show Forum Drop Down Menu