NizamUlMulk Posted October 1, 2014 Posted October 1, 2014 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 Quote
Administrators Farshad Mohajeri Posted October 1, 2014 Administrators Posted October 1, 2014 You can use URL parameters. Please see UrlParameters demo. Quote
Administrators Farshad Mohajeri Posted October 1, 2014 Administrators Posted October 1, 2014 see under uniGUI installation directory demos folder Quote
NizamUlMulk Posted October 1, 2014 Author Posted October 1, 2014 Thanks Farshad.I saw that example. In isapi we haven't UniApplication variable, what must use for read parameters? Quote
Administrators Farshad Mohajeri Posted October 1, 2014 Administrators Posted October 1, 2014 It does work in ISAPI mode too. .../URLParamsDemo.dll?button=BB&edit=AA Quote
NizamUlMulk Posted October 1, 2014 Author Posted October 1, 2014 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? Quote
MariusTurnkey Posted October 1, 2014 Posted October 1, 2014 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 Quote
Administrators Farshad Mohajeri Posted October 1, 2014 Administrators Posted October 1, 2014 But in ISAPI not uses UniApplication. Sorry I did not understand. What do you exactly mean by above statement? Quote
ZigZig Posted October 1, 2014 Posted October 1, 2014 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 Quote
NizamUlMulk Posted October 2, 2014 Author Posted October 2, 2014 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! Quote
Administrators Farshad Mohajeri Posted October 2, 2014 Administrators Posted October 2, 2014 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. Quote
chefdackel Posted October 2, 2014 Posted October 2, 2014 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 Quote
Administrators Farshad Mohajeri Posted October 2, 2014 Administrators Posted October 2, 2014 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; Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.