in the itk demo, there is an example of a http call (get and post) that will retrieve a page.
the result can easily be included in a page. this kind of functionality is frequently used in other languages like php and it is conveniently called include.
we use it on our site to include custom client content, and it woks quite well.

We don't currently have a copy of ITK, so I guess that route is not an immediate option.

You could achieve the same thing with 4D Internet Commands. Take a look at IC Playground (http://www.hdind.com/4dresources/) to see how to do an HTTP get with 4DIC.



I'm using the built-in 4D Server web server with A4D, but I need to allow clients to make changes to their content. So, I want to give them FTP access to my W*V server, then include files from there within my A4D pages.

What I do in this case is network mount the ftp server volume and then directly access the files in that volume through an alias in my Active4D web root. So it looks like this:


Active4D server         ftp server
---------------         ----------------
web (root)              ftp_docs  (volume)
   index.a4d        |----->docs
   docs (alias)-----|          doc1.html
                               doc2.html

In this scheme you just reference the docs on the ftp server with a URL like this:

   include("/docs/doc1.html")

You have to make sure to add the absolute path of the docs directory on the ftp server to the "safe script dirs" list in Active4D.ini, like this:

safe script dirs = /ftp_docs/docs


Aparajita: Am I right to assume there is not any way to do something simple, like ...

<%
include("http://www.something.com/page.txt";)
%>

I'm glad you think it's simple.


Would this be difficult to implement in a future version?

Active4D will never directly deal with TCP/IP. If I were to implement it, I would just be calling a 4D helper method, and you could VERY easily do the same as I would do:


- Write a 4D method called WEB_Include to do the HTTP get and return the page text to Active4D.
- Do this:


   execute(WEB_Include($inURL); *)

Take a look at the Active4D documentation for execute to see why this works.

Regards,

   Aparajita
   Victory-Heart Productions
   [EMAIL PROTECTED]
   www.aparajitaworld.com

   "If you dare to fail, you are bound to succeed."
   - Sri Chinmoy   |   www.srichinmoylibrary.com




Reply via email to