Re: [WebDNA] how can i grab the contents of a post?

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 106728
interpreted = N
texte = This is a multi-part message in MIME format. --------------050205040108060003040307 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I had already written and tested the XML logic in webdna so to save time I just wrote the following lines of PHP that grabbed the post contents, assigned it to a form variable, and redirected it to a webdna script for processing. The parse.tpl returns XML and this PHP script sends it back to the requestor with the correct HTTP header. This could probably be collapsed to two lines but what I have above works and it is good enough :) Psi Prime Inc, Matthew A Perosi wrote: > Since I'm completely ignorant when it comes to PHP, what is the code > you used? > Did you grab the incoming content, save it as a file then had WebDNA > trigger occasionally for the written file? > > Matt > --------------050205040108060003040307 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I had already written and tested the XML logic in webdna so to save time I just wrote the following lines of PHP that grabbed the post contents, assigned it to a form variable, and redirected it to a webdna script for processing. The parse.tpl returns XML and this PHP script sends it back to the requestor with the correct HTTP header.

<?php
if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){
    $postText = file_get_contents('php://input');
}
$content = file_get_contents("http://www.kanuhawaii.org/ted/parse.tpl?thisxml=".urlencode($postText));
header("Content-type: text/xml");
echo $content;
?>

This could probably be collapsed to two lines but what I have above works and it is good enough :)

<?php
header("Content-type: text/xml");
echo file_get_contents("http://yourserver/parse.tpl?thisxml=".urlencode(file_get_contents('php://input')));
?>
 


Psi Prime Inc, Matthew A Perosi wrote:
Since I'm completely ignorant when it comes to PHP, what is the code you used? 
Did you grab the incoming content, save it as a file then had WebDNA trigger occasionally for the written file?

Matt

--------------050205040108060003040307-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] how can i grab the contents of a post? ("Brian B. Burton" 2011)
  2. Re: [WebDNA] how can i grab the contents of a post? (Aaron Michael Kaczmarek 2011)
  3. Re: [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
  4. Re: [WebDNA] how can i grab the contents of a post? (Aaron Michael Kaczmarek 2011)
  5. Re: [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
  6. Re: [WebDNA] how can i grab the contents of a post? ("Psi Prime Inc, Matthew A Perosi " 2011)
  7. Re: [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
  8. Re: [WebDNA] how can i grab the contents of a post? ("Psi Prime Inc, Matthew A Perosi " 2011)
  9. Re: [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
  10. Re: [WebDNA] how can i grab the contents of a post? (Stuart Tremain 2011)
  11. Re: [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
  12. Re: [WebDNA] how can i grab the contents of a post? (Stuart Tremain 2011)
  13. Re: [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
  14. Re: [WebDNA] how can i grab the contents of a post? (Stuart Tremain 2011)
  15. Re: [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
  16. Re: [WebDNA] how can i grab the contents of a post? (Stuart Tremain 2011)
  17. [WebDNA] how can i grab the contents of a post? (Olin Lagon 2011)
This is a multi-part message in MIME format. --------------050205040108060003040307 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I had already written and tested the XML logic in webdna so to save time I just wrote the following lines of PHP that grabbed the post contents, assigned it to a form variable, and redirected it to a webdna script for processing. The parse.tpl returns XML and this PHP script sends it back to the requestor with the correct HTTP header. This could probably be collapsed to two lines but what I have above works and it is good enough :) Psi Prime Inc, Matthew A Perosi wrote: > Since I'm completely ignorant when it comes to PHP, what is the code > you used? > Did you grab the incoming content, save it as a file then had WebDNA > trigger occasionally for the written file? > > Matt > --------------050205040108060003040307 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I had already written and tested the XML logic in webdna so to save time I just wrote the following lines of PHP that grabbed the post contents, assigned it to a form variable, and redirected it to a webdna script for processing. The parse.tpl returns XML and this PHP script sends it back to the requestor with the correct HTTP header.

<?php
if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){
    $postText = file_get_contents('php://input');
}
$content = file_get_contents("http://www.kanuhawaii.org/ted/parse.tpl?thisxml=".urlencode($postText));
header("Content-type: text/xml");
echo $content;
?>

This could probably be collapsed to two lines but what I have above works and it is good enough :)

<?php
header("Content-type: text/xml");
echo file_get_contents("http://yourserver/parse.tpl?thisxml=".urlencode(file_get_contents('php://input')));
?>
 


Psi Prime Inc, Matthew A Perosi wrote:
Since I'm completely ignorant when it comes to PHP, what is the code you used? 
Did you grab the incoming content, save it as a file then had WebDNA trigger occasionally for the written file?

Matt

--------------050205040108060003040307-- Olin Lagon

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Friday brain fry (2001) REPLACE & MAX/STARTAT parameters doesn't work? (2000) OT JavaScript question (1999) Quitting WebMerchant ? (1997) Summ=T Problem (1997) [OT] (waaaay OT) further off topic than before (2004) Template Encryption (1998) [Reload mydata.db] (1998) HomePage Caution (1997) Re-Shipping using Book/Ship Method (2004) [WebDNA] Pretty URLS (2011) frames & carts (1997) Running _every_ page through WebCat ? (1997) Verifying and adding new users (1997) WebCat2final1 crashes (1997) WebCat2.0 [format thousands .0f] no go (1997) autosensing lanague selection (1997) webcat2b12 CGI -- Date comparisons (1997) [shell] (2002) FW: ANother SHOWIF problem (1997)