Jump to content
uniGUI Discussion Forums
NizamUlMulk

passing HTML vars to ISAPI unigui application

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

 

 

Share this post


Link to post
Share on other sites

Thanks Farshad.
I saw that example.

In isapi we haven't UniApplication variable, what must use for read parameters?

Share this post


Link to post
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?
 

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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;

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×