Link to home
Start Free TrialLog in
Avatar of anakecil
anakecil

asked on

Get CGI Form contain variable and email it

I wanna know how to get the number or string on each text area or radio button from form variables. Also how can I send them in simple structured format to my email account.All should created on CGI-BIN Delphi2 with NT 4.0 server only using IIS.YGOLAN already give me guide on how to get environment variable on QUERY_STRING, but I really only get the thingy beside the cgi.exe?xxx=xxx string, but I want to get the strings which we can get from user input when they submit their form.For example I have a query text area asking about user name, and a button for submit it. So what should I do in both HTML and CGI program also how can I send it to my email so I canalerted that user has input their data ??below HTML is what I do now please confirm if there should any change on it :<Form Action="/cgi-bin/cgi.exe" method="post">Your name:<BR><input type="text" name="name"><p><input type="submit" value="ok"></form>Also what I really want received at my email is formated like this below :Name : user_namethats all folks thxx for your attentionI'll appreciate your help.
Avatar of chrb
chrb

This isn't a answer to your question, but :
Have you tried ISAPI instead of CGI?

Chr
Avatar of anakecil

ASKER

Thxx for your comment crb, if I can use ISAPI, I will, but I don't know how since I'm newbies on Delphi and website programming.-AnaKecil -
I am not sure if I'am right but I think the server executes ISAPI's faster and you will get some nice functions :)

Chr
Yes you right I guess, thought I'm not yet even know about how to program on ISAPI thingy, but I'm sure ISAPI better than CGI since that's why microsoft create it for standard and borland also supported it on Delphi 3. But the thing is my delphi is ver 2.0 so can I still program on ISAPI without any additional thingy, cause I already browse the www.borland.com but I can't get anything ISAPI for my 2.0 version and only for 3.0 available.Also rather than just comment please answer my question if you can my friend :) thxx you very much for your attention.
ASKER CERTIFIED SOLUTION
Avatar of ygolan
ygolan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wow okie I sought to try your answer ASAP :)But can you tell me how to create simple"HELLO WORLD" like at CGI in ISAPI usesDelphi 2.0 without any additional thingy component ??nice thxxx you answer excellent - AnaKecil -
Library project1;

Uses Classes, SysUtils, Windows, ISAPI;

Function GetExtensionVersion (var pVer : THSE_VERSION_INFO) : BOOL; export; stdcall;
begin
  pVer.dwExtensionVersion := MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
  StrPCopy(pVer.lpszExtensionDesc, 'Hello World Sample DLL');
  result := true;
end;

Function HttpExtensionProc (var pECB : TEXTENSION_CONTROL_BLOCK) : DWORD; export; stdcall;
const
  HelloMsg : string = 'Hello World';
var
  Size: dword;
  DataType: dword;
begin
  pECB.ServerSupportFunction( pECB.ConnID,
                            HSE_REQ_SEND_RESPONSE_HEADER,
                            nil,
                            Size,
                            DataType);

  Size := Length(HelloMsg);
  pECB.WriteClient( pECB.ConnID, PChar(HelloMsg), Size, 0 );
  result := HSE_STATUS_SUCCESS;
end;
 
exports
  HttpExtensionProc,
  GetExtensionVersion;


begin
end.
Thxx so much :) I'll try that one for my first ISAPI app. Anyway could you give me description on your email send program ? so I may think about to buy that component :) also tell me can I pay you via VISA CARD ??okie you always excellent- AnaKecil -
What I've developed is not a email send component. Instead, it's a framework for developing Web applications using Delphi. It's called WebApp, and you download a preview version from ftp://ftp.hyperact.com/pub/beta/wapprvw.zip.

If you need more information, contact me through ygolan@hyperact.com.