The same code is actually working in a similar Cfv5 form. Any suggestions?
Here below the snippet:
<?php
/* preparazione stringhe */
$comune ="<h1>Riceverai a breve una mail di benvenuto: ti invitiamo a controllare anche la cartella SPAM o Posta indesiderata. <br /><br />
Se hai ancora dubbi, prima di reinoltrare la richiesta d'iscrizione ti suggeriamo di contattarci all'indirizzo <u>info@progettistisociali.it</u>. Grazie. <br /><br /></h1>";
$messaggio ="<strong>Facendo click sul pulsante potrai pagare la quota prevista con Paypal o carta di credito</strong><br /><br />";
/* paypal + pulsante soci */
$paypalsoci = "<p style=\"text-align: center; font-size: 150%; color: #840000;\"><strong>Stai effettuando l'iscrizione come socio/a A.P.I.S.</strong></p>";
$pulsantesoci = "<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"_top\">
<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">
<input type=\"hidden\" name=\"hosted_button_id\" value=\"UQXMCJL7L6R8N\">
<input type=\"image\" src=\"https://www.paypalobjects.com/it_IT/IT/i/btn/btn_buynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal è il metodo rapido e sicuro per pagare e farsi pagare online.\">
<img alt=\"\" border=\"0\" src=\"https://www.paypalobjects.com/it_IT/i/scr/pixel.gif\" width=\"1\" height=\"1\">
</form>";
/*paypal + pulsante non soci */
$paypal_nonsoci = "<p style=\"text-align: center; font-size: 150%; color: #840000;\"><strong>Stai effettuando l'iscrizione all'A.P.I.S. per partecipare al corso</strong></p>";
$pulsante_nonsoci = "<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"_top\">
<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">
<input type=\"hidden\" name=\"hosted_button_id\" value=\"MY8SW3A4SG4EW\">
<input type=\"image\" src=\"https://www.paypalobjects.com/it_IT/IT/i/btn/btn_buynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal è il metodo rapido e sicuro per pagare e farsi pagare online.\">
<img alt=\"\" border=\"0\" src=\"https://www.paypalobjects.com/it_IT/i/scr/pixel.gif\" width=\"1\" height=\"1\">
</form>";
/* bonifici */
$bonifico = "<p style=\"text-align: center; font-size: 150%; color: #840000;\"><strong>Pagamento via bonifico bancario</strong></p>";
$bonifico_nonsoci = "<div style=\"border: 2px solid; border-radius: 5px; padding: 5px;\"><strong>Effettua un bonifico di € 340,00 intestato a A.P.I.S., IBAN IT36E0501803200000000129727 presso Banca Etica, indicando come Causale: <br />Iscrizione Corso Base 7a Edizione «tuo nome e cognome».<br /> N.B. Per rendere più celere l'iscrizione invia copia della contabile bancaria a corsi@progettistisociali.it</strong></div><br />";
$bonifico_soci = "<div style=\"border: 2px solid; border-radius: 5px; padding: 5px;\"><strong>Effettua un bonifico di € 240,00 intestato a A.P.I.S., IBAN IT36E0501803200000000129727 presso Banca Etica, indicando come Causale: <br />Iscrizione Corso Base 7a Edizione «tuo nome e cognome».<br /> N.B. Per rendere più celere l'iscrizione invia copia della contabile bancaria a corsi@progettistisociali.it</strong></div><br />";
$iscrizione = $this->data['iscrizione'];
$pagamento = $this->data['pagamento'];
/* il messaggio visualizzato cambia in base alle selezioni */
switch ($iscrizione) {
case "socio":
if ($pagamento == "paypal") {
echo $comune . $paypalsoci . $messaggio . $pulsantesoci;
} else {
echo $comune . $bonifico . $bonifico_soci;
}
break;
case "nonsocio":
if ($pagamento == "paypal") {
echo $comune . $paypal_nonsoci . $messaggio . $pulsante_nonsoci;
} else {
echo $comune . $bonifico. $bonifico_nonsoci;
}
break;
}
?>
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
I need custom code for my form
What is the Custom Code action?
P.S: I'm just an automated service😉
I think that in CFv6 you may need to leave out the <?php ?> tags - though I'm not certain.
How exactly does this fail?
Bob
edit: if I leave out the <?php ?> tags the message is displayed but not in the right way. I see comments and variables assignation, as you can see in the example below:
$messaggio ="Facendo click sul pulsante potrai pagare la quota prevista con Paypal o carta di credito
"; /* paypal + pulsante soci */ $paypalsoci = "
Stai effettuando l'iscrizione come socio/a A.P.I.S.
Thanks fon any suggestion
Please try setting the Site Error Reporting temporarily to Maximum and see if you get a more helpful Error Message.
Bob
By all means PM me the site URL, the form name, and a SuperAdmin login and I'll take a quick look.
Bob
I think it is OK now- your custom code was checking for values socie and nonsocie but the radio buttons are set to soci and nonsoci.
Bob
However, now it works as expected. Thank you very much Bob
