Rev cgi, PHP & XML

Jan Schenkel janschenkel at yahoo.com
Thu Aug 23 06:52:05 EDT 2007


--- jbv <jbv.silences at club-internet.fr> wrote:
> Hi folks,
> 
> It's me again with another weird question... this
> time for php
> experts...
> 
> I have a Rev cgi script that returns some xml data
> to a client browser.
> In order to speed up downloading, I'm trying to
> compress the data
> using gzip via some php functions (such as gzencode
> or gzcompress).
> I had to use that technique because Rev compress()
> function doesn't
> output code suitable for browsers...
> 
> Anyway, here's my code :
> 
> - in Rev cgi script
> 
> get shell("/usr/local/bin/php
> /home/httpd/html/cgi-bin/gzcompress.php "
> & myXMLdata)
> 
> 
> - in php
> 
>     <?php
> 
>      $myString = $argv[1];
> 
>      $myStringgz = gzencode( $myString , 9 );
> 
>       echo $myStringgz;
> 
>     ?>
> 
> 
> This works fine for any non-XML data. As soon as I
> try to pass XML data
> to the php script,
> I get this error :
>     /bin/sh: line 1: syntax error near unexpected
> token `<'
> 
> Could someone be kind enough to tell me what I'm
> doing wrong ?
> Is there any specific gzlib function for xml data ?
> I haven't found
> anything like that in php doc...
> 
> Any help greatly apreciated.  Thanks in advance,
> JB
> 

Hi JB,

Try dumping the XML data to a file in the
temp-directory, and piping that into the php script.
Otherwise the shell will try to interpet the content
of the variable myXMLData as extra parameters.

Hope this helped,

Jan Schenkel.

Quartam Reports & PDF Library for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


       
____________________________________________________________________________________
Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.com/collections/222



More information about the use-livecode mailing list