cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <a.schrijv...@hippo.nl>
Subject RE: json post
Date Sun, 05 Nov 2006 20:11:57 GMT
Is it possible to add the parameters to src=" http://www.myhost.com/{1}.php" ? So, if you get
a post with param id, just call src=" http://www.myhost.com/{1}.php?id={request-param:id}".
There also must be some way to append all request parameters with one input module, I forgot
how, but there has been a thread about it ones, you could find it in the archives. But, you
are then changing a POST into a GET then, with parameters in the url, perhaps you dont want
this. 

Can't the ProxyTransformer, or the cinclude transformer help you out (though I am not to familiar
with both)...you probably have to change them a little since you are expecting text/javascript...

Regards Ard


Greetings all.

I found out that FileGenerator may let me grab output from a PHP page that outputs javascript
code (header("Content-Type: text/javascript");):
Unfortunately it does NOT propagate the POST data sent by javascript JSON call. 

<!--sitemap snip-->
<map:match pattern="*.json">
  <map:generate type="text" mime-type="application/javascript" src=" http://www.myhost.com/{1}.php">
  <map:serialize type="text">
</map:match>

Indeed i successfully receive the Javascript string that i produce from PHP, but PHP does
NOT receive POST data from JSON call. 

The QUESTION is: i DO POST data from browser javascript function ---> to cocoon -->
arriving to PHP and back, but in some way in PHP i don't see any parameter sent by the browser,
so i presume that cocoon is NOT sending the params that browser sent to it through calling
xmlhttp.send.

I tested the example using just php and it is functioning good (POST data from json call is
in $GLOBALS['HTTP_RAW_POST_DATA']), but when i pass through cocoon i loose POST data in some
way.

Is there any way i can POST data in javascript to a PHP page ? 

May a gentle soul between U all give me an hint (and maybe a piece of code) that can drive
me to solution, please?

Any idea is well accepted.

thanks in advance to all.

Maurizio
-----------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message