AFP"

This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2). For the latest documentation about current CKSource projects, including software like CKEditor 4/CKEditor 5, CKFinder 3, Cloud Services, Letters, Accessibility Checker, please visit the new documentation website.

If you look for an information about very old versions of CKEditor, FCKeditor and CKFinder check also the CKEditor forum, which was closed in 2015. If not, please head to StackOverflow for support.

Line 11: Line 11:
 
</pre>
 
</pre>
  
=== Step 2 ===  
+
=== Step 2 ===
  
Now the FCKeditor is available and ready to use. So, just insert the following code in your page to create an instance of the editor inside a <FORM>:
+
Now the FCKeditor is available and ready to use. So, just insert the following code in your page to create an instance of the editor inside a &lt;FORM&gt;:
 +
<pre>&lt;form action="sampleposteddata.afp" method="post" target="_blank"&gt;
 +
&lt;%
  
<pre>
+
sBasePath = "/fckeditor/" &amp;&amp; &lt;-- Change this to your local path
<form action="sampleposteddata.afp" method="post" target="_blank">
 
<%
 
  
sBasePath="../../../fckeditor/"        && <-- Change this to your local path
+
lcText = [This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using ]
 
+
lcText = lcText + [&lt;a href='http://www.fckeditor.net/'&gt;FCKeditor&lt;/a&gt;.]
lcText=[This is some <strong>sample text</strong>. You are using ]
 
lcText=lcText+[<a href='http://www.fckeditor.net/'>FCKeditor</a>.]
 
  
 
oFCKeditor = CREATEOBJECT("FCKeditor")
 
oFCKeditor = CREATEOBJECT("FCKeditor")
 
oFCKeditor.fckeditor("FCKeditor1")
 
oFCKeditor.fckeditor("FCKeditor1")
oFCKeditor.BasePath     = sBasePath  
+
oFCKeditor.BasePath = sBasePath  
oFCKeditor.cValue       = lcText
+
oFCKeditor.cValue = lcText
  
 
? oFCKeditor.Create()  
 
? oFCKeditor.Create()  
  
%>
+
%&gt;
</pre>
+
</pre>  
 
+
"FCKeditor1" is the name used to post the editor data on forms.
"FCKeditor1" is the name used to post the editor data on forms.  
 
  
 
=== Step 3 ===
 
=== Step 3 ===

Revision as of 13:07, 2 January 2008

It is very easy to use FCKeditor in your AFP web pages. All the integration files are available in the official distributed package. To start the integration follow the instructions below.

Integration step by step

Step 1

Suppose that the editor is installed in the /fckeditor/ path of your web site. The first thing to do is to create an unique session file for the AFP - e.g. a file called fck.afpa

<application ID="fck"/>

Step 2

Now the FCKeditor is available and ready to use. So, just insert the following code in your page to create an instance of the editor inside a <FORM>:

<form action="sampleposteddata.afp" method="post" target="_blank">
<%

sBasePath = "/fckeditor/" && <-- Change this to your local path

lcText = [This is some <strong>sample text</strong>. You are using ]
lcText = lcText + [<a href='http://www.fckeditor.net/'>FCKeditor</a>.]

oFCKeditor = CREATEOBJECT("FCKeditor")
oFCKeditor.fckeditor("FCKeditor1")
oFCKeditor.BasePath = sBasePath 
oFCKeditor.cValue = lcText

? oFCKeditor.Create() 

%>

"FCKeditor1" is the name used to post the editor data on forms.

Step 3

The editor is now ready to be used. Just open the page in your browser to see it at work.

Sample code

The complete sample without HTML Overhead - find the full sample in your Samples directory.

<html><head></head><body>
<form action="sampleposteddata.afp" method="post" target="_blank">
<%
  sBasePath="../../../fckeditor/"               && <-- Change this to your local path
  lcText=[This is some <strong>sample text</strong>. You are using ]
  lcText=lcText+[<a href='http://www.fckeditor.net/'>FCKeditor</a>.]
  oFCKeditor = CREATEOBJECT("FCKeditor")
  oFCKeditor.fckeditor("FCKeditor1")
  oFCKeditor.BasePath   = sBasePath 
  oFCKeditor.cValue     = lcText
  ? oFCKeditor.Create() 
%>
<input type="submit" value="Submit">
</form>
</body></html>