Re: [WebDNA] calling a webDNA tmpl from PHP?

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 101258
interpreted = N
texte = Try sending the parameters the way curl likes them ie $var1 = shell_exec(curl "http://www.myDomain.com/myDir/myPage.tmpl" -d param1=lovely -d param2=sunday); For all the nifty things curl can do pull up the man page in your terminal. -d/--data (HTTP) Sends the specified data in a POST request to the HTTP server, in a way that can emulate as if a user has filled in a HTML form and pressed the submit button. Note that the data is sent exactly as specified with no extra processing (with all newlines cut off). The data is expected to be "url-encoded". This will cause curl to pass the data to the server using the content-type application/x- www-form-urlencoded. Compare to -F/--form. If this option is used more than once on the same command line, the data pieces specified will be merged together with a separating &-letter. Thus, using '-d name=daniel -d skill=lousy' would generate a post chunk that looks like 'name=daniel&skill=lousy'. If you start the data with the letter @, the rest should be a file name to read the data from, or - if you want curl to read the data from stdin. The contents of the file must already be url-encoded. Multiple files can also be specified. Posting data from a file named 'foobar' would thus be done with --data @foobar". To post data purely binary, you should instead use the --data-binary option. -d/--data is the same as --data-ascii. On Oct 26, 2008, at 5:09 PM, Govinda wrote: > Thanks Bob, > > I finally got to this and it works :-) > Only one issue is that the webdna I am hitting with this is only > recognizing the first URL param. Example: > > I have a webdna file with this content: > Incoming_1=[param1] > Incoming_2=[param2] > > on my html page I have this: > $var1 = shell_exec("curl http://www.myDomain.com/myDir/myPage.tmpl?param1=lovely¶m2=sunday > "); > echo ""; > > when I hit it with browser, it returns this: > > > Is this a php issue, webdna issue, or else where do I need to pursue > to get the webdna to recongnize that the second URL param/var-value > ALSO was passed in? > > -Govinda > > PS - I hope no one minds this topic which border on 2 languages.... > seems to me anyhow that examples of webdna pages being smoothly > included in PHP pages is good marketing. I mean imagine someone > (who doesn't know PHP) has an existing PHP system and they just lost > their PHP coder and they want to add quick/easy new functions > themselves... what would it take to throw in some WebDNA and cut > their learning curve by 70%? > > On Oct 21, 2008, at 11:38 PM, Bob Minor wrote: > >> create a php page with this as your code, you may need to visudo >> and give 'www' perms to execute curl i don't memember off the top >> of my head, the url can literally be ANYTHING(dna asp etc ): >> >> > >> $var1 = shell_exec("curl http://www.cybermill.com"); >> >> echo $var1; >> >> ?> >> >> >> On Oct 22, 2008, at 12:16 AM, Govinda wrote: >> >>> Bob, >>> >>> I have so far not had luck with shell_exec(). I have not yet done >>> a thing with curl and don't know anything about it except that it >>> seems we have it. >>> I realize this is OT for this list, but I just want to parse a >>> webdna tmpl from a PHP page, and I think one right line of simple >>> php will do it, and if I ask on the php lists they will be all >>> over the map. Can you provide a sample for me? >>> >>> -G > --------------------------------------------------------- > 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 > old archives: http://dev.webdna.us/TalkListArchive/ Robert Minor Director of Internet Services ------------------------------------------------------------ Cybermill Communications http://www.cybermill.com http://www.merchantmaker.com Providing Ecommerce and interactive website development and hosting services on Macintosh, Windows NT, *nix, and AS/400. Complete ddos proof hosting solutions and network services. Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] calling a webDNA tmpl from PHP? (Govinda 2008)
  2. Re: [WebDNA] calling a webDNA tmpl from PHP? (Bob Minor 2008)
  3. Re: [WebDNA] calling a webDNA tmpl from PHP? (Govinda 2008)
  4. RE: [WebDNA] calling a webDNA tmpl from PHP? ("Olin Lagon" 2008)
  5. Re: [WebDNA] calling a webDNA tmpl from PHP? (Bob Minor 2008)
  6. Re: [WebDNA] calling a webDNA tmpl from PHP? (Govinda 2008)
  7. Re: [WebDNA] calling a webDNA tmpl from PHP? (Govinda 2008)
  8. Re: [WebDNA] calling a webDNA tmpl from PHP? ("Charles Kline" 2008)
  9. Re: [WebDNA] calling a webDNA tmpl from PHP? (Bob Minor 2008)
  10. Re: [WebDNA] calling a webDNA tmpl from PHP? (Govinda 2008)
  11. Re: [WebDNA] calling a webDNA tmpl from PHP? ("Charles Kline" 2008)
  12. Re: [WebDNA] calling a webDNA tmpl from PHP? (Govinda 2008)
  13. RE: [WebDNA] calling a webDNA tmpl from PHP? ("Olin Lagon" 2008)
  14. [WebDNA] calling a webDNA tmpl from PHP? (Govinda 2008)
Try sending the parameters the way curl likes them ie $var1 = shell_exec(curl "http://www.myDomain.com/myDir/myPage.tmpl" -d param1=lovely -d param2=sunday); For all the nifty things curl can do pull up the man page in your terminal. -d/--data (HTTP) Sends the specified data in a POST request to the HTTP server, in a way that can emulate as if a user has filled in a HTML form and pressed the submit button. Note that the data is sent exactly as specified with no extra processing (with all newlines cut off). The data is expected to be "url-encoded". This will cause curl to pass the data to the server using the content-type application/x- www-form-urlencoded. Compare to -F/--form. If this option is used more than once on the same command line, the data pieces specified will be merged together with a separating &-letter. Thus, using '-d name=daniel -d skill=lousy' would generate a post chunk that looks like 'name=daniel&skill=lousy'. If you start the data with the letter @, the rest should be a file name to read the data from, or - if you want curl to read the data from stdin. The contents of the file must already be url-encoded. Multiple files can also be specified. Posting data from a file named 'foobar' would thus be done with --data @foobar". To post data purely binary, you should instead use the --data-binary option. -d/--data is the same as --data-ascii. On Oct 26, 2008, at 5:09 PM, Govinda wrote: > Thanks Bob, > > I finally got to this and it works :-) > Only one issue is that the webdna I am hitting with this is only > recognizing the first URL param. Example: > > I have a webdna file with this content: > Incoming_1=[param1] > Incoming_2=[param2] > > on my html page I have this: > $var1 = shell_exec("curl http://www.myDomain.com/myDir/myPage.tmpl?param1=lovely¶m2=sunday > "); > echo ""; > > when I hit it with browser, it returns this: > > > Is this a php issue, webdna issue, or else where do I need to pursue > to get the webdna to recongnize that the second URL param/var-value > ALSO was passed in? > > -Govinda > > PS - I hope no one minds this topic which border on 2 languages.... > seems to me anyhow that examples of webdna pages being smoothly > included in PHP pages is good marketing. I mean imagine someone > (who doesn't know PHP) has an existing PHP system and they just lost > their PHP coder and they want to add quick/easy new functions > themselves... what would it take to throw in some WebDNA and cut > their learning curve by 70%? > > On Oct 21, 2008, at 11:38 PM, Bob Minor wrote: > >> create a php page with this as your code, you may need to visudo >> and give 'www' perms to execute curl i don't memember off the top >> of my head, the url can literally be ANYTHING(dna asp etc ): >> >> > >> $var1 = shell_exec("curl http://www.cybermill.com"); >> >> echo $var1; >> >> ?> >> >> >> On Oct 22, 2008, at 12:16 AM, Govinda wrote: >> >>> Bob, >>> >>> I have so far not had luck with shell_exec(). I have not yet done >>> a thing with curl and don't know anything about it except that it >>> seems we have it. >>> I realize this is OT for this list, but I just want to parse a >>> webdna tmpl from a PHP page, and I think one right line of simple >>> php will do it, and if I ask on the php lists they will be all >>> over the map. Can you provide a sample for me? >>> >>> -G > --------------------------------------------------------- > 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 > old archives: http://dev.webdna.us/TalkListArchive/ Robert Minor Director of Internet Services ------------------------------------------------------------ Cybermill Communications http://www.cybermill.com http://www.merchantmaker.com Providing Ecommerce and interactive website development and hosting services on Macintosh, Windows NT, *nix, and AS/400. Complete ddos proof hosting solutions and network services. Bob Minor

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:

Almost a there but..bye bye NetCloak (1997) WebCatalog 4.0 has been released! (2000) WebCat2 - Getting to the browser's username/password data (1997) version 2 for NT (1997) Robots fill event log (1997) WebCat B13 Mac CGI -- Frames question (1997) Document contains no data... (1999) Upgrading old WebCat Database Files (1997) Hyperboard users wanting a quoted message (1998) old problem (2001) WebMerchant 1.6 and SHTML (1997) Help! (2000) Mac: [ListFiles] bug alert (1997) WC2b15 - [HTMLx]...[/HTMLx] problems (1997) Re:2nd WebCatalog2 Feature Request (1996) [WebDNA] WebSite Examples (2008) [BULK] [WebDNA] [BULK] which of these tags exist in 7.0 (2011) ftp to webstar (2001) Multiple catalog databases and showcart (1997) Programmer Needed (1998)