Re: a php relay to either rev cgi or onrev
Hi Friends, Nicolas, You just need to insert a simple line of javascript in your irev script to call a php piece of code from it. About a working example see : http://www.wrds.com/ contact.irev where the reCAPTCHA part relies on 3 simple php sniplets and the rest of the page on irev. In calling from a simple js snipplet directly inserted in your revTalk code the first php sniplet, you go outside of the rev loop of your process ; Then, the first php sniplet call the main php function (second php sniplet) you need to handle and have the return catched-back as your needed irev readable $_vars At this point, and it's up to you..., you can have a thirst php sniplet called from the second one, etc..., as long as you need to bind more php libs functions to the php part of your process. Feel free to adapt the reCAPTCHA process working example as a starter point : the irev form : link rel=stylesheet type=text/css href=Blog/stylesheet_1.css / fieldset table tr tdlabel for=nomNom */label/td tdinput class=textInput type=text name=nom id=nom/td /tr tr tdlabel for=entrepriseEntreprise */label/td tdinput class=textInput type=text name=entreprise id=entreprise/td /tr tr tdlabel for=activiteActivité */label/td tdinput class=textInput type=text name=activite id=activite/td /tr tr tdlabel for=adresseAdresse/label/td tdinput class=textInput type=text name=adresse id=adresse/ td /tr tr tdlabel for=villeVille/label/td tdinput class=textInput type=text name=ville id=ville/td /tr tr tdlabel for=codepostalCode postal/label/td tdinput class=textInput type=text name=codepostal id=codepostal/td /tr tr tdlabel for=emailEmail */label/td tdinput class=textInput type=text name=email id=email/td /tr tr tdlabel for=telephoneTéléphone */label/td tdinput class=textInput type=text name=telephone id=telephone/td /tr tr tdlabel for=objetObjet */label/td tdselect size=1 name=objet id=objet style=font-size:11px; color:gray; option selectedChoisir dans la liste/option option value=in#233;dits pour sites de jeux en lignelots inédits pour sites de jeux en ligne/option option value=in#233;dits pour sites agrave; vocation commercialelots inédits pour sites à vocation commerciale/option option value=in#233;dits pour sites d'informationlots inédits pour sites d'information/option option value=in#233;dits pour sites d'information localelots inédits pour sites d'information locale/option option value=in#233;dits pour sites p#233;dagogiqueslots inédits pour sites pédagogiques/option option value=in#233;dits pour presse de jeuxlots inédits pour presse de jeux/option option value=in#233;dits pour presse gratuitelots inédits pour presse gratuite/option option value=in#233;dits pour presse de loisirslots inédits pour presse de loisirs/option option value=in#233;dits pour presse généralistelots inédits pour presse généraliste/option option value=in#233;dits pour presse localelots inédits pour presse locale/option option value=autre demandeautre demande/option /select/td /tr tr tdlabel for=detailDétail/label/td tdtextarea id=detail name=detail rows=3/textarea/td /tr trtd colspan=2 height=20/td/tr trtd colspan=2 align=right script type=text/javascriptinclude('./recaptchaloader.php')/script /td/tr trtd colspan=2 height=12/td/tr trtd colspan=2 align=right input type=submit value=Envoyer name=contact_report class=bouton ## irev handled submit button /td/tr/table /fieldset the first .php sniplet used to bind the php $_vars to the irev handled submit button : ?php require_once('recaptchatmp.php'); ? the second .php sniplet : ?php require_once('recaptchalib.php'); // Get a key from http://recaptcha.net/api/getkey $publickey = your_revcaptcha_public_key_goes_there; $privatekey = your_revcaptcha_private_key_goes_there; # the response from reCAPTCHA $resp = null; # the error code from reCAPTCHA, if any $error = null; # was there a reCAPTCHA response? if ($_POST[recaptcha_response_field]) { $resp = recaptcha_check_answer ($privatekey, $_SERVER[REMOTE_ADDR], $_POST[recaptcha_challenge_field], $_POST[recaptcha_response_field]); } echo recaptcha_get_html($publickey, $error); ? witch call the 'recaptchalib.php' as the thirst one, etc... the submit button irev function handler function sc_contact_report repeat for each key k in $_POST if lang_flag_mem is not in k and contact_report is not in k and \ recaptcha_challenge_field is not in k and recaptcha_response_field is not in k then put k : $_POST[k] cr cr after aaa end repeat put $_POST[telephone] into phonectl filter phonectl with *[0-9]* if $_POST[nom] is or $_POST[entreprise] is or $_POST[activite] is or phonectl is \ or @ is not in $_POST[email] or
Re: a php relay to either rev cgi or onrev
Thank you Pierre, but I do not understand your example. Where is the ?rev declaration? How does the (rev?) function sc_contact_report get called? I see a contact_report, but no sc_contact_report. About the input type submit, shouldn't there be a form action=somefile.irev method=post line somewhere? Very confused... -- Nicolas Cueto ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: a php relay to either rev cgi or onrev
Nicolas, Thank you Pierre, but I do not understand your example. Where is the ?rev declaration? How does the (rev?) function sc_contact_report get called? I see a contact_report, but no sc_contact_report. About the input type submit, shouldn't there be a form action=somefile.irev method=post line somewhere? Very confused... -- Nicolas Cueto Le 28 juil. 09 à 09:41, Pierre Sahores a écrit : Hi Friends, Nicolas, You just need to insert a simple line of javascript in your irev script to call a php piece of code from it. About a working example see : http://www.wrds.com/contact.irev where the reCAPTCHA part relies on 3 simple php sniplets and the rest of the page on irev. In calling from a simple js snipplet directly inserted in your revTalk code the first php sniplet, you go outside of the rev loop of your process ; Then, the first php sniplet call the main php function (second php sniplet) you need to handle and have the return catched-back as your needed irev readable $_vars At this point, and it's up to you..., you can have a thirst php sniplet called from the second one, etc..., as long as you need to bind more php libs functions to the php part of your process. Feel free to adapt the reCAPTCHA process working example as a starter point : the irev form : As usual, the form method:POST tag comes after the body tag of the page : link rel=stylesheet type=text/css href=Blog/stylesheet_1.css / fieldset table tr tdlabel for=nomNom */label/td tdinput class=textInput type=text name=nom id=nom/td /tr tr tdlabel for=entrepriseEntreprise */label/td tdinput class=textInput type=text name=entreprise id=entreprise/td /tr tr tdlabel for=activiteActivité */label/td tdinput class=textInput type=text name=activite id=activite/td /tr tr tdlabel for=adresseAdresse/label/td tdinput class=textInput type=text name=adresse id=adresse/td /tr tr tdlabel for=villeVille/label/td tdinput class=textInput type=text name=ville id=ville/td /tr tr tdlabel for=codepostalCode postal/label/td tdinput class=textInput type=text name=codepostal id=codepostal/td /tr tr tdlabel for=emailEmail */label/td tdinput class=textInput type=text name=email id=email/td /tr tr tdlabel for=telephoneTéléphone */label/td tdinput class=textInput type=text name=telephone id=telephone/td /tr tr tdlabel for=objetObjet */label/td tdselect size=1 name=objet id=objet style=font-size:11px; color:gray; option selectedChoisir dans la liste/option option value=in#233;dits pour sites de jeux en lignelots inédits pour sites de jeux en ligne/option option value=in#233;dits pour sites agrave; vocation commercialelots inédits pour sites à vocation commerciale/option option value=in#233;dits pour sites d'informationlots inédits pour sites d'information/option option value=in#233;dits pour sites d'information localelots inédits pour sites d'information locale/option option value=in#233;dits pour sites p#233;dagogiqueslots inédits pour sites pédagogiques/option option value=in#233;dits pour presse de jeuxlots inédits pour presse de jeux/option option value=in#233;dits pour presse gratuitelots inédits pour presse gratuite/option option value=in#233;dits pour presse de loisirslots inédits pour presse de loisirs/option option value=in#233;dits pour presse généralistelots inédits pour presse généraliste/option option value=in#233;dits pour presse localelots inédits pour presse locale/option option value=autre demandeautre demande/option /select/td /tr tr tdlabel for=detailDétail/label/td tdtextarea id=detail name=detail rows=3/textarea/td /tr trtd colspan=2 height=20/td/tr trtd colspan=2 align=right script type=text/javascriptinclude('./recaptchaloader.php')/ script /td/tr trtd colspan=2 height=12/td/tr trtd colspan=2 align=right input type=submit value=Envoyer name=contact_report class=bouton ## irev handled submit button /td/tr/table /fieldset the /form tag comes, as usual before the /body tag If you could'nt see them in my example, it's just because this one is only a component of the final page as you can see on the wrds.com site the first .php sniplet used to bind the php $_vars to the irev handled submit button : ?php require_once('recaptchatmp.php'); ? the second .php sniplet : ?php require_once('recaptchalib.php'); // Get a key from http://recaptcha.net/api/getkey $publickey = your_revcaptcha_public_key_goes_there; $privatekey = your_revcaptcha_private_key_goes_there; # the response from reCAPTCHA $resp = null; # the error code from reCAPTCHA, if any $error = null; # was there a reCAPTCHA response? if ($_POST[recaptcha_response_field]) { $resp = recaptcha_check_answer ($privatekey, $_SERVER[REMOTE_ADDR], $_POST[recaptcha_challenge_field], $_POST[recaptcha_response_field]); } echo
Re: a php relay to either rev cgi or onrev
Nicolas, My mistake : Please read : form method=POST instead of form method:POST on the following mail -- Pierre Sahores mobile : 06 03 95 77 70 www.sahores-conseil.com Le 28 juil. 09 à 14:17, Pierre Sahores a écrit : Nicolas, Thank you Pierre, but I do not understand your example. Where is the ?rev declaration? How does the (rev?) function sc_contact_report get called? I see a contact_report, but no sc_contact_report. About the input type submit, shouldn't there be a form action=somefile.irev method=post line somewhere? Very confused... -- Nicolas Cueto Le 28 juil. 09 à 09:41, Pierre Sahores a écrit : Hi Friends, Nicolas, You just need to insert a simple line of javascript in your irev script to call a php piece of code from it. About a working example see : http://www.wrds.com/contact.irev where the reCAPTCHA part relies on 3 simple php sniplets and the rest of the page on irev. In calling from a simple js snipplet directly inserted in your revTalk code the first php sniplet, you go outside of the rev loop of your process ; Then, the first php sniplet call the main php function (second php sniplet) you need to handle and have the return catched-back as your needed irev readable $_vars At this point, and it's up to you..., you can have a thirst php sniplet called from the second one, etc..., as long as you need to bind more php libs functions to the php part of your process. Feel free to adapt the reCAPTCHA process working example as a starter point : the irev form : As usual, the form method:POST tag comes after the body tag of the page : link rel=stylesheet type=text/css href=Blog/ stylesheet_1.css / fieldset table tr tdlabel for=nomNom */label/td tdinput class=textInput type=text name=nom id=nom/td /tr tr tdlabel for=entrepriseEntreprise */label/td tdinput class=textInput type=text name=entreprise id=entreprise/td /tr tr tdlabel for=activiteActivité */label/td tdinput class=textInput type=text name=activite id=activite/td /tr tr tdlabel for=adresseAdresse/label/td tdinput class=textInput type=text name=adresse id=adresse/td /tr tr tdlabel for=villeVille/label/td tdinput class=textInput type=text name=ville id=ville/ td /tr tr tdlabel for=codepostalCode postal/label/td tdinput class=textInput type=text name=codepostal id=codepostal/td /tr tr tdlabel for=emailEmail */label/td tdinput class=textInput type=text name=email id=email/ td /tr tr tdlabel for=telephoneTéléphone */label/td tdinput class=textInput type=text name=telephone id=telephone/td /tr tr tdlabel for=objetObjet */label/td tdselect size=1 name=objet id=objet style=font-size:11px; color:gray; option selectedChoisir dans la liste/option option value=in#233;dits pour sites de jeux en lignelots inédits pour sites de jeux en ligne/option option value=in#233;dits pour sites agrave; vocation commercialelots inédits pour sites à vocation commerciale/option option value=in#233;dits pour sites d'informationlots inédits pour sites d'information/option option value=in#233;dits pour sites d'information localelots inédits pour sites d'information locale/option option value=in#233;dits pour sites p#233;dagogiqueslots inédits pour sites pédagogiques/option option value=in#233;dits pour presse de jeuxlots inédits pour presse de jeux/option option value=in#233;dits pour presse gratuitelots inédits pour presse gratuite/option option value=in#233;dits pour presse de loisirslots inédits pour presse de loisirs/option option value=in#233;dits pour presse généralistelots inédits pour presse généraliste/option option value=in#233;dits pour presse localelots inédits pour presse locale/option option value=autre demandeautre demande/option /select/td /tr tr tdlabel for=detailDétail/label/td tdtextarea id=detail name=detail rows=3/textarea/td /tr trtd colspan=2 height=20/td/tr trtd colspan=2 align=right script type=text/javascriptinclude('./recaptchaloader.php')/ script /td/tr trtd colspan=2 height=12/td/tr trtd colspan=2 align=right input type=submit value=Envoyer name=contact_report class=bouton ## irev handled submit button /td/tr/table /fieldset the /form tag comes, as usual before the /body tag If you could'nt see them in my example, it's just because this one is only a component of the final page as you can see on the wrds.com site the first .php sniplet used to bind the php $_vars to the irev handled submit button : ?php require_once('recaptchatmp.php'); ? the second .php sniplet : ?php require_once('recaptchalib.php'); // Get a key from http://recaptcha.net/api/getkey $publickey = your_revcaptcha_public_key_goes_there; $privatekey = your_revcaptcha_private_key_goes_there; # the response from reCAPTCHA $resp = null; # the error code from reCAPTCHA, if any $error = null; # was there a reCAPTCHA response? if ($_POST[recaptcha_response_field]) { $resp = recaptcha_check_answer
Re: a php relay to either rev cgi or onrev
This discussion has taken some useful and enlightening turns, but has anyone yet pinned down the specific recipe for the root problem which started this, in which it seems that Rev seems unable to get POST data in non-English/non-ISO8959-1 languages? Is there a but report filed against this? -- Richard Gaskin Fourth World Revolution training and consulting: http://www.fourthworld.com Webzine for Rev developers: http://www.revjournal.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: a php relay to either rev cgi or onrev
Interesting. I did'nt know about this. Thanks for the input, Richard -- Pierre Sahores mobile : 06 03 95 77 70 www.sahores-conseil.com Le 28 juil. 09 à 15:02, Richard Gaskin a écrit : This discussion has taken some useful and enlightening turns, but has anyone yet pinned down the specific recipe for the root problem which started this, in which it seems that Rev seems unable to get POST data in non-English/non-ISO8959-1 languages? Is there a but report filed against this? -- Richard Gaskin Fourth World Revolution training and consulting: http://www.fourthworld.com Webzine for Rev developers: http://www.revjournal.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: a php relay to either rev cgi or onrev
Perhaps usefull about the same subject : http://www.javascriptkit.com/javatutors/externalphp.shtml Pierre -- Pierre Sahores mobile : 06 03 95 77 70 www.sahores-conseil.com Le 28 juil. 09 à 09:41, Pierre Sahores a écrit : Hi Friends, Nicolas, You just need to insert a simple line of javascript in your irev script to call a php piece of code from it. About a working example see : http://www.wrds.com/contact.irev where the reCAPTCHA part relies on 3 simple php sniplets and the rest of the page on irev. In calling from a simple js snipplet directly inserted in your revTalk code the first php sniplet, you go outside of the rev loop of your process ; Then, the first php sniplet call the main php function (second php sniplet) you need to handle and have the return catched-back as your needed irev readable $_vars At this point, and it's up to you..., you can have a thirst php sniplet called from the second one, etc..., as long as you need to bind more php libs functions to the php part of your process. Feel free to adapt the reCAPTCHA process working example as a starter point : the irev form : link rel=stylesheet type=text/css href=Blog/stylesheet_1.css / fieldset table tr tdlabel for=nomNom */label/td tdinput class=textInput type=text name=nom id=nom/td /tr tr tdlabel for=entrepriseEntreprise */label/td tdinput class=textInput type=text name=entreprise id=entreprise/td /tr tr tdlabel for=activiteActivité */label/td tdinput class=textInput type=text name=activite id=activite/td /tr tr tdlabel for=adresseAdresse/label/td tdinput class=textInput type=text name=adresse id=adresse/td /tr tr tdlabel for=villeVille/label/td tdinput class=textInput type=text name=ville id=ville/td /tr tr tdlabel for=codepostalCode postal/label/td tdinput class=textInput type=text name=codepostal id=codepostal/td /tr tr tdlabel for=emailEmail */label/td tdinput class=textInput type=text name=email id=email/td /tr tr tdlabel for=telephoneTéléphone */label/td tdinput class=textInput type=text name=telephone id=telephone/td /tr tr tdlabel for=objetObjet */label/td tdselect size=1 name=objet id=objet style=font-size:11px; color:gray; option selectedChoisir dans la liste/option option value=in#233;dits pour sites de jeux en lignelots inédits pour sites de jeux en ligne/option option value=in#233;dits pour sites agrave; vocation commercialelots inédits pour sites à vocation commerciale/option option value=in#233;dits pour sites d'informationlots inédits pour sites d'information/option option value=in#233;dits pour sites d'information localelots inédits pour sites d'information locale/option option value=in#233;dits pour sites p#233;dagogiqueslots inédits pour sites pédagogiques/option option value=in#233;dits pour presse de jeuxlots inédits pour presse de jeux/option option value=in#233;dits pour presse gratuitelots inédits pour presse gratuite/option option value=in#233;dits pour presse de loisirslots inédits pour presse de loisirs/option option value=in#233;dits pour presse généralistelots inédits pour presse généraliste/option option value=in#233;dits pour presse localelots inédits pour presse locale/option option value=autre demandeautre demande/option /select/td /tr tr tdlabel for=detailDétail/label/td tdtextarea id=detail name=detail rows=3/textarea/td /tr trtd colspan=2 height=20/td/tr trtd colspan=2 align=right script type=text/javascriptinclude('./recaptchaloader.php')/ script /td/tr trtd colspan=2 height=12/td/tr trtd colspan=2 align=right input type=submit value=Envoyer name=contact_report class=bouton ## irev handled submit button /td/tr/table /fieldset the first .php sniplet used to bind the php $_vars to the irev handled submit button : ?php require_once('recaptchatmp.php'); ? the second .php sniplet : ?php require_once('recaptchalib.php'); // Get a key from http://recaptcha.net/api/getkey $publickey = your_revcaptcha_public_key_goes_there; $privatekey = your_revcaptcha_private_key_goes_there; # the response from reCAPTCHA $resp = null; # the error code from reCAPTCHA, if any $error = null; # was there a reCAPTCHA response? if ($_POST[recaptcha_response_field]) { $resp = recaptcha_check_answer ($privatekey, $_SERVER[REMOTE_ADDR], $_POST[recaptcha_challenge_field], $_POST[recaptcha_response_field]); } echo recaptcha_get_html($publickey, $error); ? witch call the 'recaptchalib.php' as the thirst one, etc... the submit button irev function handler function sc_contact_report repeat for each key k in $_POST if lang_flag_mem is not in k and contact_report is not in k and \ recaptcha_challenge_field is not in k and recaptcha_response_field is not in k then put k : $_POST[k] cr cr after aaa end repeat put
Re: a php relay to either rev cgi or onrev
On Jul 27, 2009, at 8:07 PM, Nicolas Cueto wrote: After much testing and frustation, I've discovered that the on-rev server is unable to read the $_POST array when sent by WAP/WML-based Japanese cellphones to an .irev script. As a workaround, I've make a .php script that can read in $_POST. The next step is using php to forward the $_POST data to an .irev or rev-cgi script -- assuming of course that such a thing is possible. But, I really want to avoid having to learn (any more!) php, so am instead posting this somewhat off-topic request for help. Has someone tried to use php to relay data to .irev/rev-cgi? Use PHP to extract the parts of the array you need, and then do a $_POST or $_GET to the irev/cgi using the desired variable names, just like you would if you were going to use PHP to navigate to another web page and pass variables to that page. You might have to encode the characters before sending them to irev/cgi to be successful. For example: http://subdomain.on-rev.com/area/targetStack.irev?var1=dateStrvar2=timeStrvar3=contentStrvar4=otherDataStr Then setup the 'targetStack' to look for both the GET POST using the one that is not empty. Now it can handle both methods of data arriving. In August I will start working with my On-Rev account. I have not actually done this, so hopefully this will point you in a useful direction. Jim Ault Las Vegas ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: a php relay to either rev cgi or onrev
Years ago Pierre Sahores built an application server based on Rev. He used Apache/PHP as the front end, then used socket connections between PHP and Rev so that a long-running Rev process could interact with databases, and return the results via PHP to Apache. There is a lot to recommend in his design. He has a tutorial (in french and english) here: http://www2.sahores-conseil.com/insead/index_en.html I can imagine you may not need the whole infrastructure he had in mind, but getting the Apache/PHP/Rev stuff to work sounds like it might be what you want, and from what I remember when I followed his tutorial a couple of years ago, it was all straightforward. Bernard On Tue, Jul 28, 2009 at 4:07 AM, Nicolas Cuetonicon...@gmail.com wrote: After much testing and frustation, I've discovered that the on-rev server is unable to read the $_POST array when sent by WAP/WML-based Japanese cellphones to an .irev script. As a workaround, I've make a .php script that can read in $_POST. The next step is using php to forward the $_POST data to an .irev or rev-cgi script -- assuming of course that such a thing is possible. But, I really want to avoid having to learn (any more!) php, so am instead posting this somewhat off-topic request for help. Has someone tried to use php to relay data to .irev/rev-cgi? Thanks. -- Nicolas Cueto ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution