Jump to content


Photo

passing HTML vars to ISAPI unigui application

ISAPI variables html passing session

  • Please log in to reply
13 replies to this topic

#1 NizamUlMulk

NizamUlMulk

    Member

  • uniGUI Subscriber
  • PipPip
  • 28 posts
  • LocationAsunción, Paraguay

Posted 01 October 2014 - 04:45 PM

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

 

 


  • 0

#2 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 9876 posts

Posted 01 October 2014 - 04:48 PM

You can use URL parameters.

 

Please see UrlParameters demo.


  • 0

#3 NizamUlMulk

NizamUlMulk

    Member

  • uniGUI Subscriber
  • PipPip
  • 28 posts
  • LocationAsunción, Paraguay

Posted 01 October 2014 - 04:51 PM

Where can I found that demo?


  • 0

#4 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 9876 posts

Posted 01 October 2014 - 05:00 PM

see under uniGUI installation directory demos folder


  • 0

#5 NizamUlMulk

NizamUlMulk

    Member

  • uniGUI Subscriber
  • PipPip
  • 28 posts
  • LocationAsunción, Paraguay

Posted 01 October 2014 - 05:37 PM

Thanks Farshad.
I saw that example.

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


  • 0

#6 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 9876 posts

Posted 01 October 2014 - 07:06 PM

It does work in ISAPI mode too.

.../URLParamsDemo.dll?button=BB&edit=AA

  • 0

#7 NizamUlMulk

NizamUlMulk

    Member

  • uniGUI Subscriber
  • PipPip
  • 28 posts
  • LocationAsunción, Paraguay

Posted 01 October 2014 - 07:33 PM

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?
 


  • 0

#8 MariusTurnkey

MariusTurnkey

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationSouth Africa

Posted 01 October 2014 - 07:39 PM

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


  • 0

#9 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 9876 posts

Posted 01 October 2014 - 07:45 PM

But in ISAPI not uses UniApplication.

 

 

Sorry I did not understand. What do you exactly mean by above statement?


  • 0

#10 ZigZig

ZigZig

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 340 posts

Posted 01 October 2014 - 09:26 PM

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 ?


  • 1

#11 NizamUlMulk

NizamUlMulk

    Member

  • uniGUI Subscriber
  • PipPip
  • 28 posts
  • LocationAsunción, Paraguay

Posted 02 October 2014 - 12:17 PM

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!


  • 0

#12 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 9876 posts

Posted 02 October 2014 - 02:36 PM

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.

 


  • 0

#13 chefdackel

chefdackel

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 169 posts
  • LocationGermany

Posted 02 October 2014 - 04:03 PM

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...yement/?p=22500

 

brfc


  • 0

#14 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 9876 posts

Posted 02 October 2014 - 04:16 PM

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

 

http://forums.unigui...yement/?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;

  • 0





Also tagged with one or more of these keywords: ISAPI, variables, html, passing, session

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users