View Full Version : INCLUDE scripts from remote server
I have been experimenting with simple include functions .. which include lzx scripts from a remote server ..
e.g.
<canvas>
<window layout="axis: y">
<include href="http://localhost:88/lzx/test.lzx"/>
<include href="http://localhost:88/lzx/test.lzx"/>
</window>
</canvas>
but .. compilation of above fails with error message
"unknown protocol: http"
so how can I refer to a remote content to include in a laszlo app?
Must includes only refer to local files?
___________________________________________
searching the forum I read this thread
http://www.laszlosystems.com/developers/community/forums/showthread.php?threadid=1000&highlight=include
which suggests that the weather demo offers this ..
but weather.lzx is not on a remote server.
antun
09-22-2004, 04:32 PM
Must includes only refer to local files?
That's right - you can't include LZX files from a remote server at the moment. To begin with, if you requested them over HTTP, and they resided inside of an LPS, then that LPS would compile them and return SWF bytecode, not text LZX.
searching the forum I read this thread
http://www.laszlosystems.com/develo...ghlight=include
which suggests that the weather demo offers this ..
That post was referring to the ability to have an HTML page on server A embed a Laszlo app from server B.
-Antun
Thanks .. I now understand the difference between the include and embed. I have both modes working now.
...
For inclusion of remote lzx files I have experimented with some success use of PHP for server side scripting including dynamic creation of lzx scripts.
It works like this ..
* two co-located servers (on same Windows platform, just on different ports)
* Apache / PHP on port 88
* Tomcat / Laszlo on port 8080
* both servers connected via mod_jk2 connector
* handshake between servers
now ..
I can run a PHP script on Apache/PHP server, to generate (on the fly) lzx scripts .. and (using cURL function in PHP5) to "screen scrape" PHP-generated lzx files .
Then include this dynamically generated lzx script in a Laszlo app in Tomcat server, or run it directly as an lzx file.
A bit tricky to setup .. but it works .. until I work out how to run PHP5 directly on Tomcat .. I tried that with no success so far so I'm staying with separate servers for now.
______________________________________
Reference below on PHP include (remote files):
http://php.planetmirror.com/manual/en/features.remote-files.php
Chapter 35. Using remote files
As long as allow_url_fopen is enabled in php.ini, you can use HTTP and FTP URLs with most of the functions that take a filename as a parameter. In addition, URLs can be used with the include(), include_once(), require() and require_once() statements. See Appendix L for more information about the protocols supported by PHP.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.