Richiesta di iscrizione a CR completata - Corrispondenza romana

Richiesta di iscrizione a CR completata

[insert_php]

if(
( isset($_POST[‘voxmail_nome’]) && $_POST[‘voxmail_nome’] !== “” ) &&
( isset($_POST[‘voxmail_cognome’]) && $_POST[‘voxmail_cognome’] !== “” ) &&
( isset($_POST[‘voxmail_email’]) && $_POST[‘voxmail_email’] !== “” )
){

//manage and save data to maillist
//include( ‘wrapper.php’ );

include ( __DIR__.’/../../themes/twentyten/voxmail/wrapper.php’);

//init wrapper
$host = ‘m5v9s.mailrouter.it’;
$public_key = ‘bdf51addb0a31e95e5435d78678fd780’;
$private_key = ‘86460321e85ff734e63aaeb823333c39’;
service_init( $host, $public_key, $private_key );

$data = array(
‘+audiences’ => ‘xffq2’, // gruppo in cui inserire l’utente, il codice si trova nella url
‘profile_name’ => $_POST[‘voxmail_nome’],
‘profile_surname’ => $_POST[‘voxmail_cognome’],
‘mail’ => $_POST[‘voxmail_email’],
‘profile_nazione’ => $_POST[‘voxmail_paese’] ? $_POST[‘voxmail_paese’] : ”,
‘profile_citt_’ => $_POST[‘voxmail_citta’] ? $_POST[‘voxmail_citta’] : ”,
‘profile_indirizzo’ => $_POST[‘voxmail_indirizzo’] ? $_POST[‘voxmail_indirizzo’] : ”
);

//updating user, or creating if not exists
if ( service_user_update( $_POST[‘voxmail_email’] , $data , 1 ) ){
// print page ok, ringraziamenti, ecc…

echo_form_saved();

}else{ // print page error

echo_form_data_error();
echo service_errormessage().”;
echo service_errorcode().”;

}

}else{
echo_form_data_error();
}

function echo_form_saved(){
echo ‘
Grazie per essersi iscritto alla nostra newsletter!
‘;

} // fine echo_form_saved()

function echo_form_data_error(){
echo ‘
error while saving data
‘;

} // fine echo_form_data_error()
/*
echo ‘Name: ‘.$_POST[‘voxmail_nome’].’
‘;
echo ‘Surname: ‘.$_POST[‘voxmail_cognome’].’
‘;
echo ‘Mail: ‘.$_POST[‘voxmail_email’].’
‘;
echo ‘Paese: ‘.$_POST[‘voxmail_paese’].’
‘;
echo ‘Città : ‘.$_POST[‘voxmail_citta’].’
‘;
echo ‘Indirizzo: ‘.$_POST[‘voxmail_indirizzo’].’
‘;
*/
[/insert_php]