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.--------------050205040108060003040307Content-Type: text/plain; charset=ISO-8859-1; format=flowedContent-Transfer-Encoding: 7bitI 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>--------------050205040108060003040307Content-Type: text/html; charset=ISO-8859-1Content-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:
This is a multi-part message in MIME format.--------------050205040108060003040307Content-Type: text/plain; charset=ISO-8859-1; format=flowedContent-Transfer-Encoding: 7bitI 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>--------------050205040108060003040307Content-Type: text/html; charset=ISO-8859-1Content-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:
Search Command, multiple dbs, etc. --Right! (2000)
small hairball -- stuck on [showif] for related db (1998)
instant cookies? (1999)
Weird problems with [SHOWIF]s (1997)
Show first couple of lines. (2003)
Mozilla/4. and Browser Info.txt (1997)
Virtual hosting and webcatNT (1997)
No Data Results (1997)
showif and cart (1997)
Problems with webcat 2.01 for NT (1997)
multiple credit card merchant accounts/processors (1997)
WebCatalog Work (2001)
Sites that use WebDNA (2003)
Type 11 errors setting up WebCAt 2 (1997)
listfile options (1997)
writing db to disk (1997)
Commas in search (1998)
[replaceChars] would be nice ... (1997)
Sku numbers (1997)
Include vs. lookup? (1998)