Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [HTML][PHP]Newsletter i program txtList - jak skasowac potwierdzenie adresu?
Forum PHP.pl > Forum > Przedszkole
deejey90
Witam,

Mam nastepujacy problem , jak skasowac z tego porogramu wymuszenie potwierdzenia adresu email?

program '' txtList newsletter mailing list ''
link http://skrypty.webpc.pl/pokaz667.html

slabo znam php, dopiero sie ucze...

Prosze o pomoc, dziekuje.

Udalo mi sie zrobic tak zeby po wpisaniu emaila , wyskakiwalo okienko. Jest tam adres aktywacji, ten co mial byc w emailu. Tylko teraz jak zrobic z niego link do klikniecia?questionmark.gif? sad.gif

a herf nie dziala...

Chyba dlatego ze wystepuje zmienna w adresie?
Daiquiri
Wklej swój kod - innymi słowy pochwal się co już zrobiłeś.
deejey90
  1. <?
  2. require('config.inc.php');
  3. require('functions.inc.php');
  4.  
  5. // Max execution time of script. This does not include sleep time, so only restricts time
  6. // allowed for mailing.
  7.  
  8. $type = $_GET['type'];
  9. $addr = stripslashes(urldecode($_GET['email']));
  10.  
  11. if ($type == 'sub') {
  12. // subscribe address. Actually, all it does is send the confirmation email
  13. if (!preg_match('#^([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+[^\".,?! ])$#i', $addr)) {
  14. $err = 'Your email address appears to be invalid.';
  15. }
  16. if (!isset($err)) {
  17. $f = openfile($cfg['listfile']);
  18. $exists = false;
  19. while ($item = readitem($f)) {
  20. if ($item['addr'] == $addr) {$exists = true;break;}
  21. }
  22. if ($exists) {
  23. $err = 'That address is already subscribed to the list.';
  24. }
  25. }
  26. if (!isset($err)) {
  27. // send confirmation email
  28. $headers = 'From: '.$cfg['from'];
  29. if ($cfg['headers']) {
  30. foreach ($cfg['headers'] as $val) $headers .= "\n".$val;
  31. }
  32. $headers .= "\n".$cfg['header_plain'];
  33. if (!@mail($addr, $cfg['subj_conf'], sprintf($cfg['msg_conf'], '?type=confirm&email='.urlencode($addr)), $headers)) {
  34. $err = 'There was an error sending the confirmation email. Please try again later.';
  35. }
  36. }
  37. if (!isset($err)) {
  38. // confirmation sent
  39. if (isset($cfg['returnto_conf']) && $cfg['returnto_conf'] != '') {
  40. header('Location: '.$cfg['returnto_conf']);
  41. }
  42. else {
  43. printf($cfg['template'], 'KLIKNIJ ABY ZATWIERDZIC', 'http://www.club-acme.pl/txtlist/?type=confirm&email='.$addr.' ');
  44. }
  45. }
  46. else {
  47. // problem with subscription
  48. echoerr($err);
  49. }
  50. }
  51. elseif ($type == 'unsub') {
  52. // unsubscribe address
  53. $f = openfile($cfg['listfile']);
  54. $exists = false;
  55. while ($item = readitem($f)) {
  56. if ($item['addr'] == $addr) {$exists = true;break;}
  57. }
  58. if ($exists) {
  59. delitem($f, $item['id']);
  60. }
  61. else {
  62. $err = 'That address was not found.';
  63. }
  64. if (!isset($err)) {
  65. // unsubscribe successful
  66. if (isset($cfg['returnto_unsub']) && $cfg['returnto_unsub'] != '') {
  67. header('Location: '.$cfg['returnto_unsub']);
  68. }
  69. else {
  70. printf($cfg['template'], 'Unsubscribed', 'Your address, '.$addr.' has successfully been unsubscribed from our mailing list.');
  71. }
  72. }
  73. else {
  74. // problem with unsubscription
  75. echoerr($err);
  76. }
  77. }
  78. elseif ($type == 'confirm') {
  79. // subscribe a confirmed address
  80. if (!preg_match('#^([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+[^\".,?! ])$#i', $addr)) {
  81. $err = 'Your email address appears to be invalid. If you are pasting the URL from your confirmation email, make sure the URL wasn\'t split into two lines.';
  82. }
  83. if (!isset($err)) {
  84. $f = openfile($cfg['listfile']);
  85. $exists = false;
  86. while ($item = readitem($f)) {
  87. if ($item['addr'] == $addr) {$exists = true;break;}
  88. }
  89. if ($exists) {
  90. $err = 'That address is already subscribed to the list.';
  91. }
  92. }
  93. if (!isset($err)) {
  94. // subscribe successful
  95. writeitem($f, $addr);
  96. if (isset($cfg['returnto_sub']) && $cfg['returnto_sub'] != '') {
  97. header('Location: '.$cfg['returnto_sub']);
  98. }
  99. else {
  100. printf($cfg['template'], 'Subscribed', 'Your address, '.$addr.', is now subscribed to our mailing list!');
  101. }
  102. }
  103. else {
  104. // problem with subscription
  105. echoerr($err);
  106. }
  107. }
  108.  
  109. function echoerr($err) {
  110. printf($GLOBALS['cfg']['template'], 'Error', '<font color="red">Error: '.$err.'</font>');
  111. }
  112. ?>




Dokladnie chodzi o ten link (przenioslem go z wiadomosci email do tego okienka, i dziala , no ale sie nie podswietla jako lacze, a to by ulatwilo aktywacje )


  1. printf($cfg['template'], 'KLIKNIJ ABY ZATWIERDZIC', 'http://www.club-acme.pl/txtlist/?type=confirm&email='.$addr.' ');
Daiquiri
Zerknij w plik config.inc.php na linijkę 48 (konkretniej na definicję $cfg['template']). Tam są wstawki CSS, które odpowiadają za ostylowanie tego elementu (linka).
deejey90
A powiedzial bys cos wiecej ? Jestem zielony, dopiero sie ucze... sad.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.