1
juraba
Mailing liist
  • 2004/3/20 8:55

  • juraba

  • Just popping in

  • Posts: 22

  • Since: 2003/11/23


Good mornig Xoopers... I have a little problem. I'm trying to incorporate this little script in a central block so tha my users can register to the mailing list that my provider gave it to me.. When i put it in a center block changing to php, i get a blank block. Nothing happens. Maybe the problem could be the mix of php and html ?

here is the script

//'''''''''' inserire il nome del dominio
$DOMAIN='yourdomain.com';
//'''''''''' inserire il nome della lista o delle liste
$LISTS[]='your_list';
$LISTS[]='altra_lista';
//''''''''fine configurazione

$response_template='












%%ACTION%% %%LIST%%@%%DOMAIN%%

Riceverai una mail a breve su "%%ADDRESS%%". Quello che devi fare è usare la funzione "Rispondi" del tuo client di posta
ed inviare tale risposta: non è necessario scrivere nulla.



';

?>


Iscrizione a mailing-list in php


















Indirizzo email Nome Lista / Azione  


switch ( $_POST['action'] ) {
case 'subscribe':
if ( !empty($_POST['addy']) ) {
if ( mail($list.'-subscribe-'.str_replace('@', '=', $_POST['addy']).'@'.$DOMAIN ,'', '') ) {
show_tpl($response_template, 'ISCRITTO A: ', $list, $DOMAIN, $_POST['addy']);
}
}
break;

case 'unsubscribe':
if ( !empty($_POST['addy']) ) {
if ( mail($list.'-unsubscribe-'.str_replace('@', '=', $_POST['addy']).'@'.$DOMAIN ,'', '') ) {
show_tpl($response_template, 'RIMOSSO DA: ', $list, $DOMAIN, $_POST['addy']);
}
}
break;
}

function show_tpl($tpl, $action, $list, $domain, $address) {
$tpl=str_replace('%%ACTION%%', $action, $tpl);
$tpl=str_replace('%%LIST%%', $list, $tpl);
$tpl=str_replace('%%DOMAIN%%', $domain, $tpl);
$tpl=str_replace('%%ADDRESS%%', $address, $tpl);
echo $tpl;
}
?>



-----------------------------o-----------------------------



Do i have to make a module for this instead of a block?

can you tell me how to do it...


Thanks to all.


2
Herko
Re: Mailing liist
  • 2004/3/20 9:15

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Make sure you start and end with php script, and you have to remove the initial tags. They are added automatically. But you can't start with php and end with HTML, because it closes the block as php script.

Herko

3
juraba
Re: Mailing liist
  • 2004/3/20 9:41

  • juraba

  • Just popping in

  • Posts: 22

  • Since: 2003/11/23


Thx very much for the quick replay.. mmmmm i tried to do as you said but i'm still having a blank block... there are few php and htlm tags that i don't know how to handle.
I dont'know where to put my hands

thx again...

Login

Who's Online

974 user(s) are online (349 user(s) are browsing Support Forums)


Members: 0


Guests: 974


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits