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 = 106730
interpreted = N
texte = This is a multi-part message in MIME format.--------------030703050107050003090209Content-Type: text/plain; charset=ISO-8859-1; format=flowedContent-Transfer-Encoding: 7bitAm running 6 on Linux. What platform are you using to get what you have? That would make it possible to piece back the XML.Am using an API from The Energy Detective (not published on their site) which is a real time energy monitor.Aaron Michael Kaczmarek wrote:> Could this potentially be a matter of webDNA version?>> I'm running 6 and am able to receive xml callbacks to a dna page just > fine; getting xml contents with formvariables.>> With formvariables, I get a single variable that is broken at the > first "=", so formvars returns this:> [name] = [value] = "1.0" encoding="UTF-8"?>......and so on with the rest of xml>>> what API are you working with by the way?>>>>>> On 6/13/11 11:32 AM, Olin Lagon wrote:>> 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.>>>> > 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 :)>>>> > 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>>>>> --------------------------------------------------------- This >> message is sent to you because you are subscribed to the mailing list >> . To unsubscribe, E-mail to: archives: >> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: >> support@webdna.us >> --------------------------------------------------------- This message > is sent to you because you are subscribed to the mailing list . To > unsubscribe, E-mail to: archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: > support@webdna.us --------------030703050107050003090209Content-Type: text/html; charset=ISO-8859-1Content-Transfer-Encoding: 7bit Am running 6 on Linux. What platform are you using to get what you have? That would make it possible to piece back the XML.
Am using an API from The Energy Detective (not published on their site) which is a real time energy monitor.
Aaron Michael Kaczmarek wrote: Could this potentially be a matter of webDNA version?
I'm running 6 and am able to receive xml callbacks to a dna page just fine; getting xml contents with formvariables.
With formvariables, I get a single variable that is broken at the first "=", so formvars returns this:
[name] = <?xml version
[value] = "1.0" encoding="UTF-8"?>......and so on with the rest of xml
what API are you working with by the way?
On 6/13/11 11:32 AM, Olin Lagon wrote: 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
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us
--------------030703050107050003090209--
Associated Messages, from the most recent to the oldest:
This is a multi-part message in MIME format.--------------030703050107050003090209Content-Type: text/plain; charset=ISO-8859-1; format=flowedContent-Transfer-Encoding: 7bitAm running 6 on Linux. What platform are you using to get what you have? That would make it possible to piece back the XML.Am using an API from The Energy Detective (not published on their site) which is a real time energy monitor.Aaron Michael Kaczmarek wrote:> Could this potentially be a matter of webDNA version?>> I'm running 6 and am able to receive xml callbacks to a dna page just > fine; getting xml contents with formvariables.>> With formvariables, I get a single variable that is broken at the > first "=", so formvars returns this:> [name] = [value] = "1.0" encoding="UTF-8"?>......and so on with the rest of xml>>> what API are you working with by the way?>>>>>> On 6/13/11 11:32 AM, Olin Lagon wrote:>> 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.>>>> > 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 :)>>>> > 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>>>>> --------------------------------------------------------- This >> message is sent to you because you are subscribed to the mailing list >> . To unsubscribe, E-mail to: archives: >> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: >> support@webdna.us >> --------------------------------------------------------- This message > is sent to you because you are subscribed to the mailing list . To > unsubscribe, E-mail to: archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: > support@webdna.us --------------030703050107050003090209Content-Type: text/html; charset=ISO-8859-1Content-Transfer-Encoding: 7bit Am running 6 on Linux. What platform are you using to get what you have? That would make it possible to piece back the XML.
Am using an API from The Energy Detective (not published on their site) which is a real time energy monitor.
Aaron Michael Kaczmarek wrote: Could this potentially be a matter of webDNA version?
I'm running 6 and am able to receive xml callbacks to a dna page just fine; getting xml contents with formvariables.
With formvariables, I get a single variable that is broken at the first "=", so formvars returns this:
[name] = <?xml version
[value] = "1.0" encoding="UTF-8"?>......and so on with the rest of xml
what API are you working with by the way?
On 6/13/11 11:32 AM, Olin Lagon wrote: 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
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us
--------------030703050107050003090209--
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:
syntax question, not in online refernce (1997)
Comments in db? (1997)
FYI: virus alert (1996)
Formulas.db (1997)
[WebDNA] Base 64 (2010)
Access file on a remote server (2003)
IE4.5 bug FYI (1999)
WebCat and WebTV (1997)
Tip for making barcharts (1997)
WC 2.0 frames feature (1997)
[WebDNA] merging multiple database fields into a new field (2016)
File Upload (1997)
Strange error (2000)
old cart file deletion (2000)
Server Load (2000)
Running _every_ page through WebCat ? (1997)
PCS Customer submissions ? (1997)
Search design (1997)
Need help with emailer- 2 issues (1997)
hm. (2002)