 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Shane Holmes Guest
|
Posted: Wed Apr 18, 2007 11:22 pm Post subject: Submitting Form data directly |
|
|
I have a form in an HTML page that looks like this:
<form action="valutechmagic.aem" method="POST">
<input type=hidden name='posttype' value='Logon'>
<input type=hidden name="mypagetype" value="mylogon">
<input type=hidden name="box_logon_page" value="logon_standard_b.htm">
<input type=text size=16 maxlength=16 name="Account_Username">
<input type=password size=16 maxlength=16 name="Account_Password">
<input type=submit value="Submit Form"> <input type=reset value="Reset
Form"> </p>
</form>
I need to simulate this in my ISAPI DLL (via code at runtime) without the
form being filled out and the user clicking submit button.
Is there anyway to send this info to the HTTP server without having a form.
I want to Hardcode the code and send it within my code.
Is there a component i can use?
What do I replace the Account_Username and Account_password with? I want
these hardcoded as well.
Thanks |
|
| Back to top |
|
 |
Shane Holmes Guest
|
Posted: Thu Apr 19, 2007 12:17 am Post subject: Re: Submitting Form data directly |
|
|
Thanks, I will search and see what i can find
Shane
"Guillermo Ortega" <gortega (AT) dcf (DOT) pemex.com> wrote in message
news:46266d10$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Shane Holmes wrote:
I have a form in an HTML page that looks like this:
form action="valutechmagic.aem" method="POST"
input type=hidden name='posttype' value='Logon'
I need to simulate this in my ISAPI DLL (via code at runtime) without
the form being filled out and the user clicking submit button.
Thanks
I've done this using indy idHttp (over SSL) but at this moment I don't
have access to the code. Meanwhile you can search on indy newsgroups on
how to do and http post in code, there is nothing different than doing
inside IW
Guillermo.
--
|
|
|
| Back to top |
|
 |
Guillermo Ortega Guest
|
Posted: Thu Apr 19, 2007 1:10 am Post subject: Re: Submitting Form data directly |
|
|
Shane Holmes wrote:
| Quote: | I have a form in an HTML page that looks like this:
form action="valutechmagic.aem" method="POST"
input type=hidden name='posttype' value='Logon'
I need to simulate this in my ISAPI DLL (via code at runtime) without
the form being filled out and the user clicking submit button.
Thanks
|
I've done this using indy idHttp (over SSL) but at this moment I don't
have access to the code. Meanwhile you can search on indy newsgroups on
how to do and http post in code, there is nothing different than doing
inside IW
Guillermo.
-- |
|
| Back to top |
|
 |
Guillermo Ortega Guest
|
Posted: Fri Apr 20, 2007 8:13 am Post subject: Re: Submitting Form data directly |
|
|
Shane Holmes wrote:
| Quote: | Thanks, I will search and see what i can find
Shane
"Guillermo Ortega" <gortega (AT) dcf (DOT) pemex.com> wrote in message
news:46266d10$1 (AT) newsgroups (DOT) borland.com...
Shane Holmes wrote:
I have a form in an HTML page that looks like this:
form action="valutechmagic.aem" method="POST"
input type=hidden name='posttype' value='Logon'
I need to simulate this in my ISAPI DLL (via code at runtime)
without the form being filled out and the user clicking submit
button. Thanks
I've done this using indy idHttp (over SSL) but at this moment I
don't have access to the code. Meanwhile you can search on indy
newsgroups on how to do and http post in code, there is nothing
different than doing inside IW
Guillermo.
--
|
Sample:
function TPagoTarjetaCredito.ProcesaPago(aRespuesta: TStream): Boolean;
var
loHTTP: TIdHTTP;
loIOSSLHanlder: TIdSSLIOHandlerSocket;
loForma: TStringList;
procedure VerificaYAsigna(aPropiedad, aValor: String);
begin
if aValor <> '' then
loForma.Add(aPropiedad + '=' + aValor);
end; // procedure VerificaYAsigna(aPropieda, aValor: String);
begin
//Poner los valores
loForma := TStringList.Create;
// hacer llamado usando INDY
loHTTP := TIdHTTP.Create(Nil);
loIOSSLHanlder := TIdSSLIOHandlerSocket.Create(Nil);
try
loForma.Add('Name='+FCuenta);
loforma.Add('Password='+FPassword);
loForma.Add('ClientId='+FIDClienteBanorte);
loForma.Add('Pipeline='+FPipeLine);
loForma.Add('Mode='+FMode);
loForma.Add('TransType='+FTransType);
VerificaYAsigna('BillToId',FIDFacturacion);
VerificaYAsigna('BillToFirstName',AnsiToUtf8(FNombreFacturacion));
VerificaYAsigna('BillToLastName',AnsiToUtf8(FApellidosFacturacion));
VerificaYAsigna('BillToCompany',AnsiToUtf8(FCompaniaFacturacion));
VerificaYAsigna('BillToTelVoice',AnsiToUtf8(FTelefonoFacturacion));
VerificaYAsigna('BillToFax',AnsiToUtf8(FFaxFacturacion));
VerificaYAsigna('BillToStreet1',AnsiToUtf8(Copy(FCalleFacturacion,1,60))
);
VerificaYAsigna('BillToCity',AnsiToUtf8(Copy(FCiudadFacturacin,1,25)));
VerificaYAsigna('BillToState',AnsiToUtf8(Copy(FEstadoFacturacion,1,25)))
;
VerificaYAsigna('BillToCountry',AnsiToUtf8(FPais));
VerificaYAsigna('BillToPostalCode',AnsiToUtf8(FCodigoPostal));
VerificaYAsigna('UserId',FIDCliente);
VerificaYAsigna('BirthDate',AnsiToUtf8(FFEchaNacimiento));
VerificaYAsigna('Email',AnsiToUtf8(Copy(FEmail,1,65)));
VerificaYAsigna('FedTaxId',AnsiToUtf8(FRFC));
VerificaYAsigna('Comments',AnsiToUtf8(Copy(FComentariosOrden,1,64)));
VerificaYAsigna('OrderId',FIDOrden);
VerificaYAsigna('PoNumber',FIDOrden);
VerificaYAsigna('BuyerCode',Copy(FBuyerCode,1,24));
VerificaYAsigna('ChargeDesc1',AnsiToUtf8(Copy(FDescripcionCargo1,1,40)))
;
VerificaYAsigna('ChargeDesc2',AnsiToUtf8(Copy(FDescripcionCargo2,1,40)))
;
VerificaYAsigna('ChargeDesc3',AnsiToUtf8(Copy(FDescripcionCargo3,1,40)))
;
VerificaYAsigna('ChargeDesc4',AnsiToUtf8(Copy(FDescripcionCargo4,1,40)))
;
VerificaYAsigna('Number',FNumeroTarjeta);
VerificaYAsigna('Expires',FEchaVencimiento);
VerificaYAsigna('Cvv2Indicator',FCVV2Indicator);
VerificaYAsigna('Cvv2Val',FCVV2Value);
VerificaYAsigna('PbOrderIndicator','0'); // No recurrente
VerificaYAsigna('OrderType','1'); // No recuerrente
VerificaYAsigna('Total',FloatToStr(FTotal));
VerificaYAsigna('ResponsePath',FPathRespuesta);
loHTTP.HandleRedirects := True;
loHTTP.IOHandler := loIOSSLHanlder;
try
loHTTP.Post(FHost,loForma,aRespuesta);
Result := True;
except
on E: Exception do
Result := False;
end; // try Except
finally
loHTTP.Free;
loIOSSLHanlder.Free;
loForma.Free;
end; // try finally
end;
-- |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|