January 10th, 2013, 02:08 AM
Need help for a problem
I am trying to get the IP address from the getenv but I am geting the out put as null for the REMOTE_ADDR and for HTTP_COOKIE. Bellow is my code..
char *lp_ip ;
lp_ip = getenv ("REMOTE_ADDR");
lp_cookie = getenv ("HTTP_COOKIE");
path = getenv ("PATH");
lib = getenv ("LIB");
January 10th, 2013, 03:49 AM
Are you writing a Common Gateway Interface(CGI) program?
The CGI wrapper provides you with a whole bunch of environment variables.
If you're not, then you have a fundamental mis-understanding of the problem (and we've no idea what that problem is).
January 10th, 2013, 05:30 AM
Yes, I am writing the CGI program. rather there is reference code but when I am trying to do a test program(the one above ) its not giving me the IP.