It is easy to use fpCGI with AJAX.  I use it to send JSON formatted data back and forth all the time.<br><br>You can either use a form already on the page, or build one on demand with javascript.<br><br>Make sure you have all the usual fields in the form for fpCGI submission.<br>
<br>From filePro, you just write out whatever you want to go back (I use JSON, as I mentioned) and parse it on the client side.  I have a JSON javascript class that does this for me (I could just use eval to instantiate the object literal, but that&#39;s not very robust or secure).  (eg) instead of &quot;<b>responseJson = eval(XHTP.responseText);</b> &quot; I use &quot;<b>responseJson = JSON.parse(XHTP.responseText);</b>&quot;.  <br>
<br>You can grab the JSON class at <a href="http://www.json.org/json2.js">http://www.json.org/json2.js</a> if you like.<br><br>FYI, you can also use PHP to create a direct socket connection to fpCGI and retrieve the data that way, as well.  <br>
<br>(eg)<br><b>            $sPost =&quot;&quot;;<br>            $aPost =array();<br>            $aPost[&quot;Field_ddir&quot;] =&quot;/usr/local/apache/htdocs/&quot;;<br>            $aPost[&quot;Field_base&quot;] =&quot;ajax&quot;;<br>
            $aPost[&quot;Field_cmd&quot;] =&quot;rreport someTable -fp someProcessing -sr &quot;.rand(1,500).&quot; -n -u -y automaticAJAX&quot;;<br>            $aPost[&quot;someField&quot;] =&quot;some data&quot;;</b><br>
<b>            //.....etc....</b>         <br><br>            <b>foreach ($aPost as $sFieldName=&gt;$sFieldValue) {<br>                if(!$bFirst) { $sPost .=&quot;&amp;&quot;; }<br>                $sPost .=urlencode($sFieldName).&quot;=&quot;.urlencode($sFieldValue);<br>
                $bFirst =false;<br>            }</b><br><b>            //you could write this all to the string directly instead of using an array, <br></b><b>            //</b><b>I just find it&#39;s clearer code to do it with an array </b><br>
<br>            <b>$sHeader =&quot;POST /cgi-bin/fpcgi HTTP/1.1\n&quot;<br>                        .&quot;Host: $yourServersIp\n&quot;<br>                        .&quot;Connection: Close\n&quot;<br>                        .&quot;Content-Type: application/x-www-form-urlencoded\n&quot;<br>
                        .&quot;Content-Length: &quot;.strlen($sPost)<br>                        .&quot;\n\n$sPost\n&quot;;<br>            <br>            $oSocket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);<br>            $bSuccess = socket_connect($oSocket, $yourServersIp, 80);<br>
            <br>            $iBytesSent =socket_write ($oSocket, $sHeader);<br>            <br>            $sResponse = &quot;&quot;;<br>            <br>            while ($c =socket_read($oSocket, 2056)) { $sResponse .=$c; }<br>
            <br>            socket_close($oSocket);</b><br><br><br>Feel free to hit me up if you have any questions.<br><br>-- <br>Tyler Style<br><a href="http://malthusiansolutions.com">http://malthusiansolutions.com</a><br>
<br><div class="gmail_quote">On Thu, May 21, 2009 at 12:30 AM,  <span dir="ltr">&lt;<a href="mailto:filepro-list-request@lists.celestial.com">filepro-list-request@lists.celestial.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Date: Wed, 20 May 2009 05:53:32 -0700<br>
From: <a href="mailto:jsola@newportsales.com">jsola@newportsales.com</a><br>
Subject: AJAX and FPCGI<br>

<br>
I am trying to use AJAX with FPCGI without success.  I have &quot;tricked&quot; FPCGI by<br>
generating external files and combining my code with some PHP code with<br>
success.  However, this have been a solution for simple code.  No success for<br>
complex code.  Does any one know how to direclty use AJAX with FPCGI.<br>
<br>
Att.<br>
Juan<br>
</blockquote></div><br>