[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

how do I read environment variable passed in C++

Posted on 2002-03-07
9
Medium Priority
?
268 Views
Last Modified: 2010-04-01
I am trying trying to read the user name and password passed from a form in a web page in my c++ program.

Ho doea httpheader work in c++
0
Comment
Question by:yahya
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 6847112
Please give more details..
1. Which type of c++ program u r using ISAPI . or any type of dll ?
2. In which format u r getting the value, as a form , or a paramater list from a POST/GET ?

Roshmon
0
 

Author Comment

by:yahya
ID: 6847179
1. I am using  dll
2. as a form and as a parameter list POST

thankx
 
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 6847188
U getting the parameter list ?
And u want, just extract the user name & password ...

OR

U want to know how to get this parameter list

Roshmon
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:yahya
ID: 6847198
i want to know how to get it please
0
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 400 total points
ID: 6847214
I don't know this is suitable for u. I not, please excuse me.
My suggession is use a ISAPI dll. put that dll in Web server.

Or

U can use the Netscape SDK for plug-in from Nestace site. Then u can get the data from the client side.

GOOD LUCK
0
 

Author Comment

by:yahya
ID: 6847421
This q is changed now

I am getting the HTTP header however , when I extract the value I cant find the cookie header. any idea why.

I am using w2k and VC++ v6
 thanx
0
 
LVL 86

Expert Comment

by:jkr
ID: 6848342
See http://hoohoo.ncsa.uiuc.edu/cgi/env.html
as a reference.

The following example will render this data as HTML:

#include <stdio.h>
#include <strings.h>
#include <stdlib.h>

/* Compile:
   gcc  -Wall -pedantic -pipe -O5 -o user-data user-data.c
*/  

#include <stdio.h>
#include <strings.h>
#include <stdlib.h>

int main(void) {

char* pszUser = getenv ("REMOTE_USER"); // user name
char* pszAuth = getenv ("REMOTE_AUTH"); // auth info


  puts("Content-type: text/html\n");
  puts("<HTML><HEAD><TITLE>USER DATA</TITLE></HEAD>");
  puts("<CENTER><H1 ALIGN=CENTER> Here's your user data:</H1>%s %s<HR><H2>", pszUser, pszAuth);
  puts("</H2></BODY></HTML>");
}
0
 
LVL 11

Expert Comment

by:griessh
ID: 6955286
Dear yahya

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to split between

     "roshmon and jkr"

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 6979042
Force accepted.

jkr, I will post a separate question with points for your help.

** Mindphaser - Community Support Moderator **
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question