Jump to content

passing HTML vars to ISAPI unigui application


NizamUlMulk

Recommended Posts

Hi Forum!
 

This is the case:

A HTML page with ASP define variables, Session variables.

 

 code:

 

<html>

<%

  Dim urlname

  urlName = "localhost:/cgi-bin/mydll.dll"

  Session("virtualSnipper") = MySnipperFunction(Session.id)

%>

 

  <head>
    <title>My Title</title>
  </head>
  <body>
    <iframe name="framei" id="framei" frameborder="0" width="100%" height="98%" src="<%=urlName %>">
    </iframe>
  </body>
</html>
 
When mydll.dll (an unigui web application) is called, the session has defined "virtualSnipper" value.
Hoy can read that value into my unigui application and where (datamodule, mainform, dpr) ? is it possible?..
Thanks

 

 

Link to comment
Share on other sites

yes, that is the "notation"  Farshad... but, into application. How capture that?
In UrlParameters demo uses UniGuiApplication object for capture them (UniApplication.Parameters.Values['edit´] for example).
But in ISAPI not uses UniApplication. If I add UniguiApplication to uses clause, together with uniGUIISAPI... the UniApplication is nil, never initializes....
Is it correct?. 
How Instantiate UniApplication into ISAPI project and read then the parameters html?
 

Link to comment
Share on other sites

Follow

 

Nizam I think we are possibly after the same thing over here.  It looks like something I want to do as well.  I make use of a third party SMS service, and once a Client of mine has send an sms to my allocated number, the third party simply takes that message and URL Relay it to the URL I provide to them (now this URL is my UNIGUI application, running as ISAPI DLL).

 

It must then just get the parameters and insert it into one of my databases, no UI will be presented to the third party relaying the information into my URL.

 

Is this the same you are trying to accomplish?

 

Regards

Marius

Link to comment
Share on other sites

Hi NizamUlMulk,

 

Difference between ISAPI mode and .exe mode is nothing but a compiler directive: nothing changes into your code.  Everything that works in .exe mode is written and works in the same way in ISAPI mode (except if you run a very old version of UniGUI where "VCL mode" means "Windows forms mode").

Try this code :

myURLParameter:=UniApplication.Parameters.Values['myParameter'];

Then, if you open your uniGUI application with this URL : .../URLParamsDemo.dll?myParameter=hello, you will see that UniApplication.Parameters.Values['myParameter'] is equal to 'hello'.

I use this way of getting parameters in all my ISAPI developments, I never noticed a problem.

 

If you cannot compile this piece of code, try to add uniGUIApplication to your uses clause.

 

BTW, what is your version of uniGUI ?

  • Upvote 1
Link to comment
Share on other sites

Good morning zigzig, Farshad.
Where can I see the version of unigui components?
 

I resolved the case.

In dpr file UniApplication is nil, in UniMainModule the UniApplication variable doesn't have Parameters property.

When cast TUniGUIApplication(uniApplication) the parameters are empty in UniMainModule.

Only in MainForm UniApplication exists and have the Parameters property....
The problem was I need the parameters at OnCreate moment for UniMainModule..... I was modified the application for wait for MainForm.OnShow for read thats parameters.

Now it works!

Link to comment
Share on other sites

  • Administrators

In dpr file UniApplication is nil,

 

Yes, it is expected.

 

 

in UniMainModule the UniApplication variable doesn't have Parameters property.

 

You must cast it as (UniApplication as TUniGUIApplication).Parameters

 

When cast TUniGUIApplication(uniApplication) the parameters are empty in UniMainModule.

 

I fixed this issue. In next build parameters will be visible here.

 

Link to comment
Share on other sites

Follow

 

Nizam I think we are possibly after the same thing over here.  It looks like something I want to do as well.  I make use of a third party SMS service, and once a Client of mine has send an sms to my allocated number, the third party simply takes that message and URL Relay it to the URL I provide to them (now this URL is my UNIGUI application, running as ISAPI DLL).

 

It must then just get the parameters and insert it into one of my databases, no UI will be presented to the third party relaying the information into my URL.

 

Is this the same you are trying to accomplish?

 

Regards

Marius

 

FM explained something about the payment system he uses for ordering UniGUI, maybe you can get some ideas here:

 

http://forums.unigui.com/index.php?/topic/4527-technics-of-web-payement/?p=22500

 

brfc

Link to comment
Share on other sites

  • Administrators

FM explained something about the payment system he uses for ordering UniGUI, maybe you can get some ideas here:

 

http://forums.unigui.com/index.php?/topic/4527-technics-of-web-payement/?p=22500

 

brfc

 

Yes, we have two additional events in UniServerModule where you can extract parameters too:

procedure TUniServerModule.UniGUIServerModuleHTTPCommand(
  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo;
  var Handled: Boolean);
begin

//////
end;

procedure TUniServerModule.UniGUIServerModuleHTTPDocument(
  const Document: string; const InParams: TStrings;
  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo;
  var Handled: Boolean);
begin

/////////
end;
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...